3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'It works ? Or not it works ?'; $pass = '1234'; $method = 'aes128'; var_dump(openssl_encrypt($string, $method, $pass)); die; abstract class T { static public $instanses; final private function __construct(){ } public static function getInstance() { var_dump(static::$instanses); if (!(static::$instanses instanceof static)) { static::$instanses = new static; } var_dump(static::$instanses); return static::$instanses; } } class A extends T { static public $instanses; } class B extends A { static public $instanses; } $t = A::getInstance(); var_dump($t); $t1 = B::getInstance(); var_dump($t1); new B(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/qoeLj
function name:  (null)
number of ops:  28
compiled vars:  !0 = $string, !1 = $pass, !2 = $method, !3 = $t, !4 = $t1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'It+works+%3F+Or+not+it+works+%3F'
    3     1        ASSIGN                                                   !1, '1234'
    4     2        ASSIGN                                                   !2, 'aes128'
    6     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL_BY_NAME                                       'openssl_encrypt'
          5        SEND_VAR_EX                                              !0
          6        SEND_VAR_EX                                              !2
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0  $8      
          9        SEND_VAR                                                 $8
         10        DO_ICALL                                                 
    7    11      > EXIT                                                     
   38    12*       INIT_STATIC_METHOD_CALL                                  'A', 'getInstance'
         13*       DO_FCALL                                      0  $10     
         14*       ASSIGN                                                   !3, $10
   39    15*       INIT_FCALL                                               'var_dump'
         16*       SEND_VAR                                                 !3
         17*       DO_ICALL                                                 
   41    18*       INIT_STATIC_METHOD_CALL                                  'B', 'getInstance'
         19*       DO_FCALL                                      0  $13     
         20*       ASSIGN                                                   !4, $13
   42    21*       INIT_FCALL                                               'var_dump'
         22*       SEND_VAR                                                 !4
         23*       DO_ICALL                                                 
   44    24*       NEW                                              $16     'B'
         25*       DO_FCALL                                      0          
         26*       FREE                                                     $16
   49    27*     > RETURN                                                   1

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

End of function __construct

Function getinstance:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/qoeLj
function name:  getInstance
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_STATIC_PROP_R          global lock         ~0      'instanses'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   20     4        FETCH_STATIC_PROP_R          unknown             ~2      'instanses'
          5        INSTANCEOF                                       ~3      ~2
          6        BOOL_NOT                                         ~4      ~3
          7      > JMPZ                                                     ~4, ->12
   21     8    >   NEW                          static              $6      
          9        DO_FCALL                                      0          
         10        ASSIGN_STATIC_PROP                                       'instanses'
         11        OP_DATA                                                  $6
   23    12    >   INIT_FCALL                                               'var_dump'
         13        FETCH_STATIC_PROP_R          unknown             ~8      'instanses'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
   24    16        FETCH_STATIC_PROP_R          unknown             ~10     'instanses'
         17      > RETURN                                                   ~10
   25    18*     > RETURN                                                   null

End of function getinstance

End of class T.

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

End of function __construct

Function getinstance:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/qoeLj
function name:  getInstance
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_STATIC_PROP_R          global lock         ~0      'instanses'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   20     4        FETCH_STATIC_PROP_R          unknown             ~2      'instanses'
          5        INSTANCEOF                                       ~3      ~2
          6        BOOL_NOT                                         ~4      ~3
          7      > JMPZ                                                     ~4, ->12
   21     8    >   NEW                          static              $6      
          9        DO_FCALL                                      0          
         10        ASSIGN_STATIC_PROP                                       'instanses'
         11        OP_DATA                                                  $6
   23    12    >   INIT_FCALL                                               'var_dump'
         13        FETCH_STATIC_PROP_R          unknown             ~8      'instanses'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
   24    16        FETCH_STATIC_PROP_R          unknown             ~10     'instanses'
         17      > RETURN                                                   ~10
   25    18*     > RETURN                                                   null

End of function getinstance

End of class A.

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

End of function __construct

Function getinstance:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/qoeLj
function name:  getInstance
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   INIT_FCALL                                               'var_dump'
          1        FETCH_STATIC_PROP_R          global lock         ~0      'instanses'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                                 
   20     4        FETCH_STATIC_PROP_R          unknown             ~2      'instanses'
          5        INSTANCEOF                                       ~3      ~2
          6        BOOL_NOT                                         ~4      ~3
          7      > JMPZ                                                     ~4, ->12
   21     8    >   NEW                          static              $6      
          9        DO_FCALL                                      0          
         10        ASSIGN_STATIC_PROP                                       'instanses'
         11        OP_DATA                                                  $6
   23    12    >   INIT_FCALL                                               'var_dump'
         13        FETCH_STATIC_PROP_R          unknown             ~8      'instanses'
         14        SEND_VAL                                                 ~8
         15        DO_ICALL                                                 
   24    16        FETCH_STATIC_PROP_R          unknown             ~10     'instanses'
         17      > RETURN                                                   ~10
   25    18*     > RETURN                                                   null

End of function getinstance

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.53 ms | 1404 KiB | 15 Q