3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FooBar { public function foo() { goto anythingIWantToWrite; echo 'I am skipped'; anythingIWantToWrite: // this doesn't throw an error? return "foo"; } public function baz() { goto baz; echo 'I am skipped'; baz: 'foobar'; // this doesn't throw an error? return "bar"; } } $class = new FooBar(); echo $class->foo()."\n"; echo $class->baz();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MDae8
function name:  (null)
number of ops:  11
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'FooBar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   27     3        INIT_METHOD_CALL                                         !0, 'foo'
          4        DO_FCALL                                      0  $4      
          5        CONCAT                                           ~5      $4, '%0A'
          6        ECHO                                                     ~5
   28     7        INIT_METHOD_CALL                                         !0, 'baz'
          8        DO_FCALL                                      0  $6      
          9        ECHO                                                     $6
         10      > RETURN                                                   1

Class FooBar:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MDae8
function name:  foo
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E > > JMP                                                      ->2
    8     1*       ECHO                                                     'I+am+skipped'
   11     2    > > RETURN                                                   'foo'
   12     3*     > RETURN                                                   null

End of function foo

Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MDae8
function name:  baz
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > JMP                                                      ->2
   17     1*       ECHO                                                     'I+am+skipped'
   20     2    > > RETURN                                                   'bar'
   21     3*     > RETURN                                                   null

End of function baz

End of class FooBar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.14 ms | 1423 KiB | 13 Q