3v4l.org

run code in 300+ PHP versions simultaneously
<?php class HelloWorld { static int $staticInt = 5; public function sayHello(): void { if (HelloWorld::someValue() === 5) { doFoo(function () { print 'HelloWorld::someValue(): ' . HelloWorld::someValue() . "\n"; }); } } public static function someValue(): int { return static::$staticInt; } } function doFoo(callable $cb): void { HelloWorld::$staticInt = 42; $cb(); } (new HelloWorld)->sayHello();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9bXe9
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   NEW                                              $0      'HelloWorld'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'sayHello'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function dofoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9bXe9
function name:  doFoo
number of ops:  6
compiled vars:  !0 = $cb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1        ASSIGN_STATIC_PROP                                       'staticInt', 'HelloWorld'
          2        OP_DATA                                                  42
   25     3        INIT_DYNAMIC_CALL                                        !0
          4        DO_FCALL                                      0          
   26     5      > RETURN                                                   null

End of function dofoo

Class HelloWorld:
Function sayhello:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/9bXe9
function name:  sayHello
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_STATIC_METHOD_CALL                                  'HelloWorld', 'someValue'
          1        DO_FCALL                                      0  $0      
          2        IS_IDENTICAL                                             $0, 5
          3      > JMPZ                                                     ~1, ->8
    9     4    >   INIT_FCALL_BY_NAME                                       'doFoo'
          5        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   11     6        SEND_VAL_EX                                              ~2
    9     7        DO_FCALL                                      0          
   13     8    > > RETURN                                                   null


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9bXe9
function name:  {closure}
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_STATIC_METHOD_CALL                                  'HelloWorld', 'someValue'
          1        DO_FCALL                                      0  $0      
          2        CONCAT                                           ~1      'HelloWorld%3A%3AsomeValue%28%29%3A+', $0
          3        CONCAT                                           ~2      ~1, '%0A'
          4        ECHO                                                     ~2
   11     5      > RETURN                                                   null

End of Dynamic Function 0

End of function sayhello

Function somevalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9bXe9
function name:  someValue
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'staticInt'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   19     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function somevalue

End of class HelloWorld.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.06 ms | 1000 KiB | 13 Q