3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $arr = array("test"); static function test($var) { echo "Testing: $var\n"; } } (new class extends Foo { function bar( $str ){ if( is_callable( $this->arr[0] ) ){ self::{$this->arr[0]}( $str ); } } })->bar("bla");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nGmU1
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_ANON_CLASS                               <indirect>  'foo'
          1        NEW                                              $1      $0
          2        DO_FCALL                                      0          
   18     3        INIT_METHOD_CALL                                         $1, 'bar'
          4        SEND_VAL_EX                                              'bla'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class Foo:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nGmU1
function name:  test
number of ops:  6
compiled vars:  !0 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ROPE_INIT                                     3  ~2      'Testing%3A+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
    8     5      > RETURN                                                   null

End of function test

End of class Foo.

Class Foo@anonymous:
Function bar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/nGmU1
function name:  bar
number of ops:  13
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_FCALL                                               'is_callable'
          2        FETCH_OBJ_R                                      ~1      'arr'
          3        FETCH_DIM_R                                      ~2      ~1, 0
          4        SEND_VAL                                                 ~2
          5        DO_ICALL                                         $3      
          6      > JMPZ                                                     $3, ->12
   15     7    >   FETCH_OBJ_R                                      ~4      'arr'
          8        FETCH_DIM_R                                      ~5      ~4, 0
          9        INIT_STATIC_METHOD_CALL                                  ~5
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0          
   17    12    > > RETURN                                                   null

End of function bar

End of class Foo@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.37 ms | 1388 KiB | 15 Q