3v4l.org

run code in 500+ PHP versions simultaneously
<?php class T { public $evaluated= 0; public $a= null; public function test() { $this->evaluated++; return $this; } } $t= new T(); $t->test()->a ??= "Test"; var_dump($t);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7mk6b
function name:  (null)
number of ops:  19
compiled vars:  !0 = $t
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   NEW                                                  $1      'T'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   14     3        INIT_METHOD_CALL                                             !0, 'test'
          4        DO_FCALL                                          0  $4      
          5        COPY_TMP                                             $5      $4
          6        FETCH_OBJ_IS                                         ~6      $4, 'a'
          7        COALESCE                                             ~7      ~6
          8        SEPARATE                                             $5      $5
          9        ASSIGN_OBJ                                           ~8      $5, 'a'
         10        OP_DATA                                                      'Test'
         11        QM_ASSIGN                                            ~7      ~8
         12      > JMP                                                          ->14
         13*       FREE                                                         $5
         14    >   FREE                                                         ~7
   16    15        INIT_FCALL                                                   'var_dump'
         16        SEND_VAR                                                     !0
         17        DO_ICALL                                                     
         18      > RETURN                                                       1

Class T:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7mk6b
function name:  test
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   PRE_INC_OBJ                                                  'evaluated'
    9     1        FETCH_THIS                                           ~1      
          2      > RETURN                                                       ~1
   10     3*     > RETURN                                                       null

End of function test

End of class T.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.34 ms | 1315 KiB | 14 Q