3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $baz = 'Oh hai '; public function bar($name) { try { return $this->baz . $name; } catch(\Exception $e) { return 'I have no idea what I am doing.'; } } } $foo = new Foo(); // Instance var_dump(call_user_func_array(array($foo, 'bar'), array('Mark'))); // Non staic usage var_dump(call_user_func_array(array('Foo', 'bar'), array('Mark')));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iqRFc
function name:  (null)
number of ops:  20
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   20     3        INIT_FCALL                                               'var_dump'
          4        INIT_ARRAY                                       ~4      !0
          5        ADD_ARRAY_ELEMENT                                ~4      'bar'
          6        INIT_USER_CALL                                0          'call_user_func_array', ~4
          7        SEND_ARRAY                                               <array>
          8        CHECK_UNDEF_ARGS                                         
          9        DO_FCALL                                      0  $5      
         10        SEND_VAR                                                 $5
         11        DO_ICALL                                                 
   23    12        INIT_FCALL                                               'var_dump'
         13        INIT_USER_CALL                                0          'call_user_func_array', <array>
         14        SEND_ARRAY                                               <array>
         15        CHECK_UNDEF_ARGS                                         
         16        DO_FCALL                                      0  $7      
         17        SEND_VAR                                                 $7
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iqRFc
function name:  bar
number of ops:  8
compiled vars:  !0 = $name, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
   10     1        FETCH_OBJ_R                                      ~2      'baz'
          2        CONCAT                                           ~3      ~2, !0
          3      > RETURN                                                   ~3
          4*       JMP                                                      ->7
   11     5  E > > CATCH                                       last         'Exception'
   12     6    > > RETURN                                                   'I+have+no+idea+what+I+am+doing.'
   14     7*     > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.76 ms | 1396 KiB | 15 Q