3v4l.org

run code in 300+ PHP versions simultaneously
<?php class LazyLabel { private $string1; private $string2; function __construct(&$string1, &$string2) { $this->string1 = & $string1; $this->string2 = & $string2; } function __toString() { $return = (string)$this->string1 . (string)$this->string2; return $return; } } $a = 'foo'; $b = 'bar'; $c = new LazyLabel($a, $b); echo $c . "\n"; $b = 'baz'; echo $c;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SkEe7
function name:  (null)
number of ops:  13
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'lazylabel'
   19     1        ASSIGN                                                   !0, 'foo'
   20     2        ASSIGN                                                   !1, 'bar'
   21     3        NEW                                              $5      'LazyLabel'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !2, $5
   22     8        CONCAT                                           ~8      !2, '%0A'
          9        ECHO                                                     ~8
   23    10        ASSIGN                                                   !1, 'baz'
   24    11        ECHO                                                     !2
         12      > RETURN                                                   1

Class LazyLabel:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SkEe7
function name:  __construct
number of ops:  7
compiled vars:  !0 = $string1, !1 = $string2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ASSIGN_OBJ_REF                                           'string1'
          3        OP_DATA                                                  !0
    9     4        ASSIGN_OBJ_REF                                           'string2'
          5        OP_DATA                                                  !1
   10     6      > RETURN                                                   null

End of function __construct

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SkEe7
function name:  __toString
number of ops:  10
compiled vars:  !0 = $return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   FETCH_OBJ_R                                      ~1      'string1'
          1        CAST                                          6  ~2      ~1
          2        FETCH_OBJ_R                                      ~3      'string2'
          3        CAST                                          6  ~4      ~3
          4        CONCAT                                           ~5      ~2, ~4
          5        ASSIGN                                                   !0, ~5
   15     6        VERIFY_RETURN_TYPE                                       !0
          7      > RETURN                                                   !0
   16     8*       VERIFY_RETURN_TYPE                                       
          9*     > RETURN                                                   null

End of function __tostring

End of class LazyLabel.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.67 ms | 1395 KiB | 13 Q