3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Controller { public function testAction() { } public static function staticAction() { } public function __call($method, $arguments) { } } $calls = array( array('Controller', 'testAction'), array('Controller', 'staticAction'), array('Controller', 'fooAction'), array(new Controller, 'testAction'), array(new Controller, 'staticAction'), array(new Controller, 'fooAction'), ); foreach($calls as $call) { var_dump(is_callable($call)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 28
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/FeVXj
function name:  (null)
number of ops:  30
compiled vars:  !0 = $calls, !1 = $call
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_ARRAY                                       ~2      <array>
          1        ADD_ARRAY_ELEMENT                                ~2      <array>
          2        ADD_ARRAY_ELEMENT                                ~2      <array>
   27     3        NEW                                              $3      'Controller'
          4        DO_FCALL                                      0          
          5        INIT_ARRAY                                       ~5      $3
          6        ADD_ARRAY_ELEMENT                                ~5      'testAction'
          7        ADD_ARRAY_ELEMENT                                ~2      ~5
   28     8        NEW                                              $6      'Controller'
          9        DO_FCALL                                      0          
         10        INIT_ARRAY                                       ~8      $6
         11        ADD_ARRAY_ELEMENT                                ~8      'staticAction'
         12        ADD_ARRAY_ELEMENT                                ~2      ~8
   29    13        NEW                                              $9      'Controller'
         14        DO_FCALL                                      0          
         15        INIT_ARRAY                                       ~11     $9
         16        ADD_ARRAY_ELEMENT                                ~11     'fooAction'
         17        ADD_ARRAY_ELEMENT                                ~2      ~11
   23    18        ASSIGN                                                   !0, ~2
   32    19      > FE_RESET_R                                       $13     !0, ->28
         20    > > FE_FETCH_R                                               $13, !1, ->28
   34    21    >   INIT_FCALL                                               'var_dump'
         22        INIT_FCALL                                               'is_callable'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $14     
         25        SEND_VAR                                                 $14
         26        DO_ICALL                                                 
   32    27      > JMP                                                      ->20
         28    >   FE_FREE                                                  $13
   35    29      > RETURN                                                   1

Class Controller:
Function testaction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FeVXj
function name:  testAction
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E > > RETURN                                                   null

End of function testaction

Function staticaction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FeVXj
function name:  staticAction
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   null

End of function staticaction

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FeVXj
function name:  __call
number of ops:  3
compiled vars:  !0 = $method, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2      > RETURN                                                   null

End of function __call

End of class Controller.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
258.99 ms | 1405 KiB | 18 Q