3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { /** @return A */ public function __construct() { echo __METHOD__; } /** @return A */ public static function s() {static $r; return $r ? $r : $r = new self;} } A::s(); A::s();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XT1D1
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 's'
          1        DO_FCALL                                      0          
   12     2        INIT_STATIC_METHOD_CALL                                  'A', 's'
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

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

End of function __construct

Function s:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XT1D1
function name:  s
number of ops:  10
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   BIND_STATIC                                              !0
          1      > JMPZ                                                     !0, ->4
          2    >   QM_ASSIGN                                        ~1      !0
          3      > JMP                                                      ->8
          4    >   NEW                          self                $2      
          5        DO_FCALL                                      0          
          6        ASSIGN                                           ~4      !0, $2
          7        QM_ASSIGN                                        ~1      ~4
          8    > > RETURN                                                   ~1
          9*     > RETURN                                                   null

End of function s

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.34 ms | 1394 KiB | 13 Q