3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Courier { public $name; public $home_country; public function __construct($name, $home_country) { $this->name = $name; $this->home_country = $home_country; return true; } public function __toString() { return $this->name . '(' . $this->home_country . ')'; } } $myCourier = new Courier('abc', 'USA'); echo $myCourier;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B5CNC
function name:  (null)
number of ops:  8
compiled vars:  !0 = $myCourier
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'courier'
   18     1        NEW                                              $1      'Courier'
          2        SEND_VAL_EX                                              'abc'
          3        SEND_VAL_EX                                              'USA'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   19     6        ECHO                                                     !0
          7      > RETURN                                                   1

Class Courier:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B5CNC
function name:  __construct
number of ops:  8
compiled vars:  !0 = $name, !1 = $home_country
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        ASSIGN_OBJ                                               'name'
          3        OP_DATA                                                  !0
    9     4        ASSIGN_OBJ                                               'home_country'
          5        OP_DATA                                                  !1
   10     6      > RETURN                                                   <true>
   11     7*     > 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/B5CNC
function name:  __toString
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   FETCH_OBJ_R                                      ~0      'name'
          1        CONCAT                                           ~1      ~0, '%28'
          2        FETCH_OBJ_R                                      ~2      'home_country'
          3        CONCAT                                           ~3      ~1, ~2
          4        CONCAT                                           ~4      ~3, '%29'
          5        VERIFY_RETURN_TYPE                                       ~4
          6      > RETURN                                                   ~4
   15     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function __tostring

End of class Courier.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.51 ms | 1395 KiB | 13 Q