3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Check { private static $instance; public function getInstance($name = null) { if (isset(self::$instance)) { return self::$instance; } self::$instance = $name; return self::$instance; } } $a = new Check; var_dump($a->getInstance('a')); $b = new Check; var_dump($b->getInstance('b')); var_dump($a->getInstance());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/16pJW
function name:  (null)
number of ops:  24
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'Check'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   20     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'getInstance'
          5        SEND_VAL_EX                                              'a'
          6        DO_FCALL                                      0  $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                                 
   22     9        NEW                                              $7      'Check'
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $7
   24    12        INIT_FCALL                                               'var_dump'
         13        INIT_METHOD_CALL                                         !1, 'getInstance'
         14        SEND_VAL_EX                                              'b'
         15        DO_FCALL                                      0  $10     
         16        SEND_VAR                                                 $10
         17        DO_ICALL                                                 
   26    18        INIT_FCALL                                               'var_dump'
         19        INIT_METHOD_CALL                                         !0, 'getInstance'
         20        DO_FCALL                                      0  $12     
         21        SEND_VAR                                                 $12
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Class Check:
Function getinstance:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/16pJW
function name:  getInstance
number of ops:  10
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV_INIT                                        !0      null
    9     1        ISSET_ISEMPTY_STATIC_PROP                                'instance'
          2      > JMPZ                                                     ~1, ->5
   10     3    >   FETCH_STATIC_PROP_R          unknown             ~2      'instance'
          4      > RETURN                                                   ~2
   12     5    >   ASSIGN_STATIC_PROP                                       'instance'
          6        OP_DATA                                                  !0
   14     7        FETCH_STATIC_PROP_R          unknown             ~4      'instance'
          8      > RETURN                                                   ~4
   15     9*     > RETURN                                                   null

End of function getinstance

End of class Check.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.08 ms | 1388 KiB | 15 Q