1 Symfony Debug Extension for PHP 5
2 =================================
4 This extension publishes several functions to help building powerful debugging tools.
5 It is compatible with PHP 5.3, 5.4, 5.5 and 5.6; with ZTS and non-ZTS modes.
6 It is not required thus not provided for PHP 7.
11 - exposes zval_hash/refcounts, allowing e.g. efficient exploration of arbitrary structures in PHP,
12 - does work with references, preventing memory copying.
14 Its behavior is about the same as:
19 function symfony_zval_info($key, $array, $options = 0)
22 // $options is currently not used, but could be in future version.
24 if (!array_key_exists($key, $array)) {
29 'type' => gettype($array[$key]),
30 'zval_hash' => /* hashed memory address of $array[$key] */,
31 'zval_refcount' => /* internal zval refcount of $array[$key] */,
32 'zval_isref' => /* is_ref status of $array[$key] */,
35 switch ($info['type']) {
38 'object_class' => get_class($array[$key]),
39 'object_refcount' => /* internal object refcount of $array[$key] */,
40 'object_hash' => spl_object_hash($array[$key]),
41 'object_handle' => /* internal object handle $array[$key] */,
47 'resource_handle' => (int) $array[$key],
48 'resource_type' => get_resource_type($array[$key]),
49 'resource_refcount' => /* internal resource refcount of $array[$key] */,
55 'array_count' => count($array[$key]),
61 'strlen' => strlen($array[$key]),
70 symfony_debug_backtrace()
71 -------------------------
73 This function works like debug_backtrace(), except that it can fetch the full backtrace in case of fatal errors:
76 function foo() { fatal(); }
77 function bar() { foo(); }
79 function sd() { var_dump(symfony_debug_backtrace()); }
81 register_shutdown_function('sd');
86 Fatal error: Call to undefined function fatal() in foo.php on line 42
111 string(102) "foo.php"
127 To enable the extension from source, run: