3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { static private $hackyhack = false; function __construct() { if (self::$hackyhack == false) { throw new Exception("The cure seems worse than the disease."); } self::$hackyhack = false; } static function makeFoo() { self::$hackyhack = true; $instance = new foo(); return $instance; } } $instance = foo::makeFoo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vkqKh
function name:  (null)
number of ops:  4
compiled vars:  !0 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   INIT_STATIC_METHOD_CALL                                  'foo', 'makeFoo'
          1        DO_FCALL                                      0  $1      
          2        ASSIGN                                                   !0, $1
          3      > RETURN                                                   1

Class foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vkqKh
function name:  __construct
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_STATIC_PROP_R          unknown             ~0      'hackyhack'
          1        BOOL_NOT                                         ~1      ~0
          2      > JMPZ                                                     ~1, ->7
    9     3    >   NEW                                              $2      'Exception'
          4        SEND_VAL_EX                                              'The+cure+seems+worse+than+the+disease.'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
   11     7    >   ASSIGN_STATIC_PROP                                       'hackyhack'
          8        OP_DATA                                                  <false>
   12     9      > RETURN                                                   null

End of function __construct

Function makefoo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vkqKh
function name:  makeFoo
number of ops:  7
compiled vars:  !0 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN_STATIC_PROP                                       'hackyhack'
          1        OP_DATA                                                  <true>
   16     2        NEW                                              $2      'foo'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
   18     5      > RETURN                                                   !0
   19     6*     > RETURN                                                   null

End of function makefoo

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.65 ms | 1395 KiB | 13 Q