3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); class User { public const STATUS_ACTIVE = 'active'; public const STATUS_INACTIVE = 'inactive'; public function __construct(public string $username, public string $status = self::STATUS_ACTIVE) { } } class Admin extends User { // ... public function printStatus() { // vous pouvez accéder au status comme si la propriété appartenait à Admin :) echo $this->status; } } $admin = new Admin('Lily'); $admin->printStatus();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ibKU5
function name:  (null)
number of ops:  7
compiled vars:  !0 = $admin
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   28     0  E >   NEW                                                  $1      'Admin'
          1        SEND_VAL_EX                                                  'Lily'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $1
   29     4        INIT_METHOD_CALL                                             !0, 'printStatus'
          5        DO_FCALL                                          0          
          6      > RETURN                                                       1

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

End of function __construct

End of class User.

Class Admin:
Function printstatus:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ibKU5
function name:  printStatus
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   23     0  E >   FETCH_OBJ_R                                          ~0      'status'
          1        ECHO                                                         ~0
   24     2      > RETURN                                                       null

End of function printstatus

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ibKU5
function name:  __construct
number of ops:  7
compiled vars:  !0 = $username, !1 = $status
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   10     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      <const ast>
          2        ASSIGN_OBJ                                                   'username'
          3        OP_DATA                                                      !0
          4        ASSIGN_OBJ                                                   'status'
          5        OP_DATA                                                      !1
   12     6      > RETURN                                                       null

End of function __construct

End of class Admin.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.52 ms | 2005 KiB | 13 Q