3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test_data1 = array('one','two','three'); // all is ok $test_data2 = array(array('one','two','three')); // windows error: // #The instruction at '<address>' referenced memory at '<address>'. // #The memory could not be read. // #Click OK to terminate the program. // No error shows up in console, sometimes script stops without error but sometimes executes like nothing is happening. $test_data3 = array(array('one','two','three'),array('four','five','six')); // error in PHP console: // Fatal error: Call to a member function show_message() on a non-object in c:\scripts\found-error.php on line xx // values one two three are displayed, four five and six are ommitted. class myClass { function iterate_multidim_array($array) { array_walk_recursive($array,function(&$val,$key,&$obj) { $obj->show_message($val); },$this); } function show_message($msg) { echo $msg."\n"; } } echo phpversion()."\n\n"; $myInstance = new MyClass(); $myInstance-> iterate_multidim_array($test_data3); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iZCe3
function name:  (null)
number of ops:  14
compiled vars:  !0 = $test_data1, !1 = $test_data2, !2 = $test_data3, !3 = $myInstance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
   12     2        ASSIGN                                                   !2, <array>
   31     3        INIT_FCALL                                               'phpversion'
          4        DO_ICALL                                         $7      
          5        CONCAT                                           ~8      $7, '%0A%0A'
          6        ECHO                                                     ~8
   32     7        NEW                                              $9      'MyClass'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !3, $9
   33    10        INIT_METHOD_CALL                                         !3, 'iterate_multidim_array'
         11        SEND_VAR_EX                                              !2
         12        DO_FCALL                                      0          
   34    13      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FiZCe3%3A20%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iZCe3
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $val, !1 = $key, !2 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   21     3        INIT_METHOD_CALL                                         !2, 'show_message'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
   22     6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FiZCe3%3A20%240

Class myClass:
Function iterate_multidim_array:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iZCe3
function name:  iterate_multidim_array
number of ops:  9
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        INIT_FCALL                                               'array_walk_recursive'
          2        SEND_REF                                                 !0
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FiZCe3%3A20%240'
   22     4        SEND_VAL                                                 ~1
          5        FETCH_THIS                                       ~2      
          6        SEND_VAL                                                 ~2
          7        DO_ICALL                                                 
   23     8      > RETURN                                                   null

End of function iterate_multidim_array

Function show_message:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iZCe3
function name:  show_message
number of ops:  4
compiled vars:  !0 = $msg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   26     1        CONCAT                                           ~1      !0, '%0A'
          2        ECHO                                                     ~1
   27     3      > RETURN                                                   null

End of function show_message

End of class myClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.77 ms | 1405 KiB | 17 Q