3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Fare { private $value; public function __construct($value) { $this->value = $value; } } class Trip { public $fare; public function __construct() { $this->fare = new Fare(5); } } $trip = new Trip(); $trip2 = clone $trip; var_dump($trip === $trip2, $trip->fare === $trip2->fare);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MZCNW
function name:  (null)
number of ops:  14
compiled vars:  !0 = $trip, !1 = $trip2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'Trip'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   18     3        CLONE                                            ~5      !0
          4        ASSIGN                                                   !1, ~5
   20     5        INIT_FCALL                                               'var_dump'
          6        IS_IDENTICAL                                     ~7      !0, !1
          7        SEND_VAL                                                 ~7
          8        FETCH_OBJ_R                                      ~8      !0, 'fare'
          9        FETCH_OBJ_R                                      ~9      !1, 'fare'
         10        IS_IDENTICAL                                     ~10     ~8, ~9
         11        SEND_VAL                                                 ~10
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class Fare:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MZCNW
function name:  __construct
number of ops:  4
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        ASSIGN_OBJ                                               'value'
          2        OP_DATA                                                  !0
          3      > RETURN                                                   null

End of function __construct

End of class Fare.

Class Trip:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MZCNW
function name:  __construct
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'Fare'
          1        SEND_VAL_EX                                              5
          2        DO_FCALL                                      0          
          3        ASSIGN_OBJ                                               'fare'
          4        OP_DATA                                                  $1
   14     5      > RETURN                                                   null

End of function __construct

End of class Trip.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.99 ms | 1401 KiB | 15 Q