3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Lol { abstract public static function run(); public static function onceLol() { if (static::$cache!==NULL) { return static::$cache; } static::$cache = static::run(); return static::$cache; } } class Lol1 extends Lol { protected static $cache = NULL; public static function run() { echo "Lol1\n"; return 'PHP is the best language in the shit'; } } class Lol2 extends Lol { protected static $cache = NULL; public static function run() { echo "Lol2\n"; return 'Just lol'; } } echo Lol1::onceLol(); // echoing 'PHP is the best language in the shit' from Lol1 echo "\n"; echo Lol2::onceLol(); // echoing 'PHP is the best language in the shit' from Lol1 echo "\n"; echo Lol1::onceLol(); // echoing 'PHP is the best language in the shit' from Lol1 echo "\n"; echo Lol2::onceLol(); // echoing 'PHP is the best language in the shit' from Lol1
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/snc6s
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   INIT_STATIC_METHOD_CALL                                  'Lol1', 'onceLol'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   34     3        ECHO                                                     '%0A'
   35     4        INIT_STATIC_METHOD_CALL                                  'Lol2', 'onceLol'
          5        DO_FCALL                                      0  $1      
          6        ECHO                                                     $1
   36     7        ECHO                                                     '%0A'
   37     8        INIT_STATIC_METHOD_CALL                                  'Lol1', 'onceLol'
          9        DO_FCALL                                      0  $2      
         10        ECHO                                                     $2
   38    11        ECHO                                                     '%0A'
   39    12        INIT_STATIC_METHOD_CALL                                  'Lol2', 'onceLol'
         13        DO_FCALL                                      0  $3      
         14        ECHO                                                     $3
         15      > RETURN                                                   1

Class Lol:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/snc6s
function name:  run
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   null

End of function run

Function oncelol:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/snc6s
function name:  onceLol
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'cache'
          1        TYPE_CHECK                                  1020          ~0
          2      > JMPZ                                                     ~1, ->5
    8     3    >   FETCH_STATIC_PROP_R          unknown             ~2      'cache'
          4      > RETURN                                                   ~2
   10     5    >   INIT_STATIC_METHOD_CALL                                  'run'
          6        DO_FCALL                                      0  $4      
          7        ASSIGN_STATIC_PROP                                       'cache'
          8        OP_DATA                                                  $4
   11     9        FETCH_STATIC_PROP_R          unknown             ~5      'cache'
         10      > RETURN                                                   ~5
   12    11*     > RETURN                                                   null

End of function oncelol

End of class Lol.

Class Lol1:
Function run:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/snc6s
function name:  run
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ECHO                                                     'Lol1%0A'
   20     1      > RETURN                                                   'PHP+is+the+best+language+in+the+shit'
   21     2*     > RETURN                                                   null

End of function run

Function oncelol:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/snc6s
function name:  onceLol
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'cache'
          1        TYPE_CHECK                                  1020          ~0
          2      > JMPZ                                                     ~1, ->5
    8     3    >   FETCH_STATIC_PROP_R          unknown             ~2      'cache'
          4      > RETURN                                                   ~2
   10     5    >   INIT_STATIC_METHOD_CALL                                  'run'
          6        DO_FCALL                                      0  $4      
          7        ASSIGN_STATIC_PROP                                       'cache'
          8        OP_DATA                                                  $4
   11     9        FETCH_STATIC_PROP_R          unknown             ~5      'cache'
         10      > RETURN                                                   ~5
   12    11*     > RETURN                                                   null

End of function oncelol

End of class Lol1.

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

End of function run

Function oncelol:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/snc6s
function name:  onceLol
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'cache'
          1        TYPE_CHECK                                  1020          ~0
          2      > JMPZ                                                     ~1, ->5
    8     3    >   FETCH_STATIC_PROP_R          unknown             ~2      'cache'
          4      > RETURN                                                   ~2
   10     5    >   INIT_STATIC_METHOD_CALL                                  'run'
          6        DO_FCALL                                      0  $4      
          7        ASSIGN_STATIC_PROP                                       'cache'
          8        OP_DATA                                                  $4
   11     9        FETCH_STATIC_PROP_R          unknown             ~5      'cache'
         10      > RETURN                                                   ~5
   12    11*     > RETURN                                                   null

End of function oncelol

End of class Lol2.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.9 ms | 1004 KiB | 13 Q