3v4l.org

run code in 300+ PHP versions simultaneously
<?php function singleton( $value = null ) { static $data; if ( $value !== null ) { $data = $value; } return $data; } singleton( 100 ); echo singleton();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iqKUC
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'singleton'
          1        SEND_VAL                                                 100
          2        DO_FCALL                                      0          
   16     3        INIT_FCALL                                               'singleton'
          4        DO_FCALL                                      0  $1      
          5        ECHO                                                     $1
          6      > RETURN                                                   1

Function singleton:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/iqKUC
function name:  singleton
number of ops:  7
compiled vars:  !0 = $value, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                        !0      null
    5     1        BIND_STATIC                                              !1
    7     2        TYPE_CHECK                                  1020          !0
          3      > JMPZ                                                     ~2, ->5
    9     4    >   ASSIGN                                                   !1, !0
   12     5    > > RETURN                                                   !1
   13     6*     > RETURN                                                   null

End of function singleton

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.37 ms | 1397 KiB | 15 Q