3v4l.org

run code in 300+ PHP versions simultaneously
<?php class time{ public static $x; public function echoTime() { $this->x = time(); echo $this->x; } } class A { public static function test() { $time = new time(); $time->echoTime(); } } A::test(); sleep(2); A::test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IEqO0
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'test'
          1        DO_FCALL                                      0          
   18     2        INIT_FCALL                                               'sleep'
          3        SEND_VAL                                                 2
          4        DO_ICALL                                                 
   19     5        INIT_STATIC_METHOD_CALL                                  'A', 'test'
          6        DO_FCALL                                      0          
          7      > RETURN                                                   1

Class time:
Function echotime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IEqO0
function name:  echoTime
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_FCALL                                               'time'
          1        DO_ICALL                                         $1      
          2        ASSIGN_OBJ                                               'x'
          3        OP_DATA                                                  $1
    7     4        FETCH_OBJ_R                                      ~2      'x'
          5        ECHO                                                     ~2
    8     6      > RETURN                                                   null

End of function echotime

End of class time.

Class A:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IEqO0
function name:  test
number of ops:  6
compiled vars:  !0 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   NEW                                              $1      'time'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   13     3        INIT_METHOD_CALL                                         !0, 'echoTime'
          4        DO_FCALL                                      0          
   14     5      > RETURN                                                   null

End of function test

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.88 ms | 1395 KiB | 17 Q