3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User{ public $name = ""; public $surname = ""; public $last = ""; public function __construct($name, $surname, $last) { $this->name = $name; $this->surname = $surname; $this->last = $last; } public function toArray() { return (array)$this; } } $user = new User('claudio', 'ludovico', 'last'); var_dump($user->toArray());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YafLA
function name:  (null)
number of ops:  12
compiled vars:  !0 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'User'
          1        SEND_VAL_EX                                              'claudio'
          2        SEND_VAL_EX                                              'ludovico'
          3        SEND_VAL_EX                                              'last'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   24     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'toArray'
          8        DO_FCALL                                      0  $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

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

End of function __construct

Function toarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YafLA
function name:  toArray
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   FETCH_THIS                                       ~0      
          1        CAST                                          7  ~1      ~0
          2      > RETURN                                                   ~1
   19     3*     > RETURN                                                   null

End of function toarray

End of class User.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.05 ms | 1396 KiB | 15 Q