3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B { } class A { public function M() { echo("this=" . get_class($this) . " hash=" . spl_object_hash($this) . "\n"); $x = "this"; $$x = new B(); echo("this=" . get_class($this) . " hash=" . spl_object_hash($this) . "\n"); } } $a = new A(); $a->M();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DDgo9
function name:  (null)
number of ops:  6
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $1      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   18     3        INIT_METHOD_CALL                                         !0, 'M'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class B: [no user functions]
Class A:
Function m:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DDgo9
function name:  M
number of ops:  28
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_THIS                                       ~1      
          1        GET_CLASS                                        ~2      ~1
          2        CONCAT                                           ~3      'this%3D', ~2
          3        CONCAT                                           ~4      ~3, '+hash%3D'
          4        INIT_FCALL                                               'spl_object_hash'
          5        FETCH_THIS                                       ~5      
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                         $6      
          8        CONCAT                                           ~7      ~4, $6
          9        CONCAT                                           ~8      ~7, '%0A'
         10        ECHO                                                     ~8
   11    11        ASSIGN                                                   !0, 'this'
   12    12        NEW                                              $11     'B'
         13        DO_FCALL                                      0          
         14        FETCH_W                      local               $10     !0
         15        ASSIGN                                                   $10, $11
   13    16        FETCH_THIS                                       ~14     
         17        GET_CLASS                                        ~15     ~14
         18        CONCAT                                           ~16     'this%3D', ~15
         19        CONCAT                                           ~17     ~16, '+hash%3D'
         20        INIT_FCALL                                               'spl_object_hash'
         21        FETCH_THIS                                       ~18     
         22        SEND_VAL                                                 ~18
         23        DO_ICALL                                         $19     
         24        CONCAT                                           ~20     ~17, $19
         25        CONCAT                                           ~21     ~20, '%0A'
         26        ECHO                                                     ~21
   14    27      > RETURN                                                   null

End of function m

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.34 ms | 1396 KiB | 15 Q