3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo strtotime("now"), "\n"; echo strtotime("10 September 2000"), "\n"; echo strtotime("+1 day"), "\n"; echo strtotime("+1 week"), "\n"; echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\n"; echo strtotime("next Thursday"), "\n"; echo strtotime("last Monday"), "\n"; die; abstract class T { static public $instanses; final private function __construct(){ } public static function getInstance() { if (!(static::$instanses instanceof static)) { static::$instanses = new static; } 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/rVUbk
function name:  (null)
number of ops:  52
compiled vars:  !0 = $t, !1 = $t1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'strtotime'
          1        SEND_VAL                                                 'now'
          2        DO_ICALL                                         $2      
          3        ECHO                                                     $2
          4        ECHO                                                     '%0A'
    3     5        INIT_FCALL                                               'strtotime'
          6        SEND_VAL                                                 '10+September+2000'
          7        DO_ICALL                                         $3      
          8        ECHO                                                     $3
          9        ECHO                                                     '%0A'
    4    10        INIT_FCALL                                               'strtotime'
         11        SEND_VAL                                                 '%2B1+day'
         12        DO_ICALL                                         $4      
         13        ECHO                                                     $4
         14        ECHO                                                     '%0A'
    5    15        INIT_FCALL                                               'strtotime'
         16        SEND_VAL                                                 '%2B1+week'
         17        DO_ICALL                                         $5      
         18        ECHO                                                     $5
         19        ECHO                                                     '%0A'
    6    20        INIT_FCALL                                               'strtotime'
         21        SEND_VAL                                                 '%2B1+week+2+days+4+hours+2+seconds'
         22        DO_ICALL                                         $6      
         23        ECHO                                                     $6
         24        ECHO                                                     '%0A'
    7    25        INIT_FCALL                                               'strtotime'
         26        SEND_VAL                                                 'next+Thursday'
         27        DO_ICALL                                         $7      
         28        ECHO                                                     $7
         29        ECHO                                                     '%0A'
    8    30        INIT_FCALL                                               'strtotime'
         31        SEND_VAL                                                 'last+Monday'
         32        DO_ICALL                                         $8      
         33        ECHO                                                     $8
         34        ECHO                                                     '%0A'
    9    35      > EXIT                                                     
   39    36*       INIT_STATIC_METHOD_CALL                                  'A', 'getInstance'
         37*       DO_FCALL                                      0  $9      
         38*       ASSIGN                                                   !0, $9
   40    39*       INIT_FCALL                                               'var_dump'
         40*       SEND_VAR                                                 !0
         41*       DO_ICALL                                                 
   42    42*       INIT_STATIC_METHOD_CALL                                  'B', 'getInstance'
         43*       DO_FCALL                                      0  $12     
         44*       ASSIGN                                                   !1, $12
   43    45*       INIT_FCALL                                               'var_dump'
         46*       SEND_VAR                                                 !1
         47*       DO_ICALL                                                 
   45    48*       NEW                                              $15     'B'
         49*       DO_FCALL                                      0          
         50*       FREE                                                     $15
   47    51*     > RETURN                                                   1

Class T:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rVUbk
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     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 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/rVUbk
function name:  getInstance
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'instanses'
          1        INSTANCEOF                                       ~1      ~0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->8
   22     4    >   NEW                          static              $4      
          5        DO_FCALL                                      0          
          6        ASSIGN_STATIC_PROP                                       'instanses'
          7        OP_DATA                                                  $4
   25     8    >   FETCH_STATIC_PROP_R          unknown             ~6      'instanses'
          9      > RETURN                                                   ~6
   26    10*     > 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/rVUbk
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     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 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/rVUbk
function name:  getInstance
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'instanses'
          1        INSTANCEOF                                       ~1      ~0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->8
   22     4    >   NEW                          static              $4      
          5        DO_FCALL                                      0          
          6        ASSIGN_STATIC_PROP                                       'instanses'
          7        OP_DATA                                                  $4
   25     8    >   FETCH_STATIC_PROP_R          unknown             ~6      'instanses'
          9      > RETURN                                                   ~6
   26    10*     > 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/rVUbk
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     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 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/rVUbk
function name:  getInstance
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'instanses'
          1        INSTANCEOF                                       ~1      ~0
          2        BOOL_NOT                                         ~2      ~1
          3      > JMPZ                                                     ~2, ->8
   22     4    >   NEW                          static              $4      
          5        DO_FCALL                                      0          
          6        ASSIGN_STATIC_PROP                                       'instanses'
          7        OP_DATA                                                  $4
   25     8    >   FETCH_STATIC_PROP_R          unknown             ~6      'instanses'
          9      > RETURN                                                   ~6
   26    10*     > RETURN                                                   null

End of function getinstance

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
135.68 ms | 1404 KiB | 17 Q