3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { public $firstName; public $lastName; public function sayHello(){ echo 'Hello ' . $this->firstName . ' ' . $this->lastName; return $this; } public function register(){ echo 'Registered ' . $this->firstName; return $this; } public function mail(){ return 'Emailed'; } } $user1 = new User(); $user1->firstName = 'John'; $user1->lastName = 'Doe'; echo $user1->sayHello()->register()->mail();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/god1f
function name:  (null)
number of ops:  15
compiled vars:  !0 = $user1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'User'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        ASSIGN_OBJ                                               !0, 'firstName'
          4        OP_DATA                                                  'John'
   26     5        ASSIGN_OBJ                                               !0, 'lastName'
          6        OP_DATA                                                  'Doe'
   27     7        INIT_METHOD_CALL                                         !0, 'sayHello'
          8        DO_FCALL                                      0  $6      
          9        INIT_METHOD_CALL                                         $6, 'register'
         10        DO_FCALL                                      0  $7      
         11        INIT_METHOD_CALL                                         $7, 'mail'
         12        DO_FCALL                                      0  $8      
         13        ECHO                                                     $8
         14      > RETURN                                                   1

Class User:
Function sayhello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/god1f
function name:  sayHello
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   FETCH_OBJ_R                                      ~0      'firstName'
          1        CONCAT                                           ~1      'Hello+', ~0
          2        CONCAT                                           ~2      ~1, '+'
          3        FETCH_OBJ_R                                      ~3      'lastName'
          4        CONCAT                                           ~4      ~2, ~3
          5        ECHO                                                     ~4
    8     6        FETCH_THIS                                       ~5      
          7      > RETURN                                                   ~5
    9     8*     > RETURN                                                   null

End of function sayhello

Function register:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/god1f
function name:  register
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_OBJ_R                                      ~0      'firstName'
          1        CONCAT                                           ~1      'Registered+', ~0
          2        ECHO                                                     ~1
   13     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   14     5*     > RETURN                                                   null

End of function register

Function mail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/god1f
function name:  mail
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E > > RETURN                                                   'Emailed'
   18     1*     > RETURN                                                   null

End of function mail

End of class User.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.82 ms | 1007 KiB | 13 Q