3v4l.org

run code in 300+ PHP versions simultaneously
<?php function wtf(array $arrayUnderTest) { echo is_callable($arrayUnderTest) ? 'This is a callable' : 'This is not a callable'; echo "\n"; echo is_array($arrayUnderTest) ? 'This is an array' : 'This is not an array'; $arrayUnderTest(); } class x { function foo() { print "\nfoo"; } } $x = new x(); $test = array($x, "foo"); $testStdClass = array(new \StdClass(), '__construct'); wtf($test); wtf($testStdClass);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XlCtW
function name:  (null)
number of ops:  18
compiled vars:  !0 = $x, !1 = $test, !2 = $testStdClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $3      'x'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   17     3        INIT_ARRAY                                       ~6      !0
          4        ADD_ARRAY_ELEMENT                                ~6      'foo'
          5        ASSIGN                                                   !1, ~6
   19     6        NEW                                              $8      'StdClass'
          7        DO_FCALL                                      0          
          8        INIT_ARRAY                                       ~10     $8
          9        ADD_ARRAY_ELEMENT                                ~10     '__construct'
         10        ASSIGN                                                   !2, ~10
   21    11        INIT_FCALL                                               'wtf'
         12        SEND_VAR                                                 !1
         13        DO_FCALL                                      0          
   22    14        INIT_FCALL                                               'wtf'
         15        SEND_VAR                                                 !2
         16        DO_FCALL                                      0          
         17      > RETURN                                                   1

Function wtf:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
Branch analysis from position: 14
filename:       /in/XlCtW
function name:  wtf
number of ops:  19
compiled vars:  !0 = $arrayUnderTest
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'is_callable'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > JMPZ                                                     $1, ->7
          5    >   QM_ASSIGN                                        ~2      'This+is+a+callable'
          6      > JMP                                                      ->8
          7    >   QM_ASSIGN                                        ~2      'This+is+not+a+callable'
          8    >   ECHO                                                     ~2
    5     9        ECHO                                                     '%0A'
    6    10        TYPE_CHECK                                  128          !0
         11      > JMPZ                                                     ~3, ->14
         12    >   QM_ASSIGN                                        ~4      'This+is+an+array'
         13      > JMP                                                      ->15
         14    >   QM_ASSIGN                                        ~4      'This+is+not+an+array'
         15    >   ECHO                                                     ~4
    7    16        INIT_DYNAMIC_CALL                                        !0
         17        DO_FCALL                                      0          
    8    18      > RETURN                                                   null

End of function wtf

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

End of function foo

End of class x.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.6 ms | 1403 KiB | 17 Q