3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($var) { echo "Testing: $var\n"; } class foo { var $arr = "test"; function bar($str) { echo is_callable( $this->arr )? 'yes' : 'no'; $this->arr($str); } } $foo = new foo; $foo->bar("bla"); // yes
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YQB5F
function name:  (null)
number of ops:  7
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $1      'foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   17     3        INIT_METHOD_CALL                                         !0, 'bar'
          4        SEND_VAL_EX                                              'bla'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

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

End of function test

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

End of function bar

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.87 ms | 1396 KiB | 15 Q