3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function foo() { print "in Test->foo()\n"; } public static function bar() { print "in Test::bar()\n"; } public function __call($name, $args) { throw new Exception("failed to call Test->".$name."()\n"); } public static function __callStatic($name, $args) { throw new Exception("failed to call Test::".$name."()\n"); } } $foo = new Test(); $foo->foo(); $foo::bar(); try { $foo->foz(); } catch (Exception $e) { print $e->getMessage(); } try { $foo::baz(); } catch (Exception $e) { print $e->getMessage(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 11
Branch analysis from position: 11
2 jumps found. (Code = 107) Position 1 = 12, Position 2 = -2
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Found catch point at position: 19
Branch analysis from position: 19
2 jumps found. (Code = 107) Position 1 = 20, Position 2 = -2
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nXTgV
function name:  (null)
number of ops:  24
compiled vars:  !0 = $foo, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $2      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   25     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        DO_FCALL                                      0          
   26     5        FETCH_CLASS                                   0  $6      !0
          6        INIT_STATIC_METHOD_CALL                                  $6, 'bar'
          7        DO_FCALL                                      0          
   29     8        INIT_METHOD_CALL                                         !0, 'foz'
          9        DO_FCALL                                      0          
         10      > JMP                                                      ->15
   30    11  E > > CATCH                                       last         'Exception'
   31    12    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         13        DO_FCALL                                      0  $9      
         14        ECHO                                                     $9
   34    15    >   FETCH_CLASS                                   0  $10     !0
         16        INIT_STATIC_METHOD_CALL                                  $10, 'baz'
         17        DO_FCALL                                      0          
         18      > JMP                                                      ->23
   35    19  E > > CATCH                                       last         'Exception'
   36    20    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         21        DO_FCALL                                      0  $12     
         22        ECHO                                                     $12
   37    23    > > RETURN                                                   1

Class Test:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nXTgV
function name:  foo
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     'in+Test-%3Efoo%28%29%0A'
    7     1      > RETURN                                                   null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nXTgV
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     'in+Test%3A%3Abar%28%29%0A'
   11     1      > RETURN                                                   null

End of function bar

Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/nXTgV
function name:  __call
number of ops:  9
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        NEW                                              $2      'Exception'
          3        CONCAT                                           ~3      'failed+to+call+Test-%3E', !0
          4        CONCAT                                           ~4      ~3, '%28%29%0A'
          5        SEND_VAL_EX                                              ~4
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $2
   15     8*     > RETURN                                                   null

End of function __call

Function __callstatic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/nXTgV
function name:  __callStatic
number of ops:  9
compiled vars:  !0 = $name, !1 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        NEW                                              $2      'Exception'
          3        CONCAT                                           ~3      'failed+to+call+Test%3A%3A', !0
          4        CONCAT                                           ~4      ~3, '%28%29%0A'
          5        SEND_VAL_EX                                              ~4
          6        DO_FCALL                                      0          
          7      > THROW                                         0          $2
   19     8*     > RETURN                                                   null

End of function __callstatic

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.26 ms | 1399 KiB | 13 Q