3v4l.org

run code in 300+ PHP versions simultaneously
<?php class first { public function getI() { static $a = null; if ($a == null) { $a = new stdClass(); } return $a; } } $f = new first(); $n = $f->getI(); var_export($n); var_export($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Gq3g9
function name:  (null)
number of ops:  13
compiled vars:  !0 = $f, !1 = $n, !2 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $3      'first'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
   14     3        INIT_METHOD_CALL                                         !0, 'getI'
          4        DO_FCALL                                      0  $6      
          5        ASSIGN                                                   !1, $6
   15     6        INIT_FCALL                                               'var_export'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
   16     9        INIT_FCALL                                               'var_export'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Class first:
Function geti:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/Gq3g9
function name:  getI
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   BIND_STATIC                                              !0
    6     1        IS_EQUAL                                                 !0, null
          2      > JMPZ                                                     ~1, ->6
    7     3    >   NEW                                              $2      'stdClass'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
    9     6    > > RETURN                                                   !0
   10     7*     > RETURN                                                   null

End of function geti

End of class first.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.12 ms | 1395 KiB | 15 Q