3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function bar() { // Do something conditionally if a child class has implemented a certain method. if (is_callable('static::methodName')) { static::methodName(); } } } (new Foo())->bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VeVYC
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   NEW                                                  $0      'Foo'
          1        DO_FCALL                                          0          
          2        INIT_METHOD_CALL                                             $0, 'bar'
          3        DO_FCALL                                          0          
          4      > RETURN                                                       1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 6
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/VeVYC
function name:  bar
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                                   'is_callable'
          1        SEND_VAL                                                     'static%3A%3AmethodName'
          2        DO_ICALL                                             $0      
          3      > JMPZ                                                         $0, ->6
    7     4    >   INIT_STATIC_METHOD_CALL                                      'methodName'
          5        DO_FCALL                                          0          
    9     6    > > RETURN                                                       null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
129.54 ms | 1853 KiB | 14 Q