3v4l.org

run code in 300+ PHP versions simultaneously
<?php class cm404 { public $str = ''; function init() { if (isset($GLOBALS['ryat'])) { exit('hi'); } unset($GLOBALS['hi']); } function __destruct() { global $obj; var_dump($obj); if(!is_object($obj)) { $obj = new cm404(); } echo "hi, $GLOBALS[hi]\n"; var_dump($obj); } } function _get() { // var_dump($obj); } $ryat = 1; $hi = 'ryat'; $obj = new cm404(); $obj->init(); $hi = 'cm404';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3GvTq
function name:  (null)
number of ops:  9
compiled vars:  !0 = $ryat, !1 = $hi, !2 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   ASSIGN                                                   !0, 1
   30     1        ASSIGN                                                   !1, 'ryat'
   31     2        NEW                                              $5      'cm404'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !2, $5
   32     5        INIT_METHOD_CALL                                         !2, 'init'
          6        DO_FCALL                                      0          
   33     7        ASSIGN                                                   !1, 'cm404'
          8      > RETURN                                                   1

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

End of function _get

Class cm404:
Function init:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3GvTq
function name:  init
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_IS                                         ~0      'GLOBALS'
          1        ISSET_ISEMPTY_DIM_OBJ                         0          ~0, 'ryat'
          2      > JMPZ                                                     ~1, ->4
    8     3    > > EXIT                                                     'hi'
   11     4    >   FETCH_UNSET                                      $2      'GLOBALS'
          5        UNSET_DIM                                                $2, 'hi'
   12     6      > RETURN                                                   null

End of function init

Function __destruct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/3GvTq
function name:  __destruct
number of ops:  20
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   BIND_GLOBAL                                              !0, 'obj'
   16     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
   17     4        TYPE_CHECK                                  256  ~2      !0
          5        BOOL_NOT                                         ~3      ~2
          6      > JMPZ                                                     ~3, ->10
   18     7    >   NEW                                              $4      'cm404'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !0, $4
   20    10    >   ROPE_INIT                                     3  ~10     'hi%2C+'
         11        FETCH_R                      global              ~7      'GLOBALS'
         12        FETCH_DIM_R                                      ~8      ~7, 'hi'
         13        ROPE_ADD                                      1  ~10     ~10, ~8
         14        ROPE_END                                      2  ~9      ~10, '%0A'
         15        ECHO                                                     ~9
   21    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
   22    19      > RETURN                                                   null

End of function __destruct

End of class cm404.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.82 ms | 1400 KiB | 15 Q