3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); namespace App\Entity; class Email { private string $email; private ?string $domain; public function __construct(string $email) { $this->email = $email; $this->setDomainFromEmail($email); } public function getEmail(): string { return $this->email; } public function getDomain(): ?string { return $this->domain; } public function __toString(): string { return $this->email; } private function setDomainFromEmail(string $email): void { preg_match('/^.+@(.*)/', $email, $matches); $this->domain = $matches[1] ?? null; } } #[ORM\Entity] class User { public function __construct( #[ORM\Column] private string|Stringable $firstName, #[ORM\Column] private string|Stringable $lastName, #[ORM\Column] private string|Stringable|Email $email, #[ORM\Column] private null|string|Stringable $cuid = null, #[ORM\Column] private ?int $id = null, ) {} public function getId(): ?int { return $this->id; } public function getFirstName(): string|Stringable { return $this->firstName; } public function getLastName(): string|Stringable { return $this->lastName; } public function getEmail(): Email|string|Stringable { return $this->email; } public function getCuid(): null|string|Stringable { return $this->cuid; } public function __toString(): string { return "$this->firstName $this->lastName"; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jfUsh
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'app%5Centity%5Cemail'
   40     1        DECLARE_CLASS                                            'app%5Centity%5Cuser'
   83     2      > RETURN                                                   1

Class App\Entity\Email:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jfUsh
function name:  __construct
number of ops:  7
compiled vars:  !0 = $email
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        ASSIGN_OBJ                                               'email'
          2        OP_DATA                                                  !0
   14     3        INIT_METHOD_CALL                                         'setDomainFromEmail'
          4        SEND_VAR_EX                                              !0
          5        DO_FCALL                                      0          
   15     6      > RETURN                                                   null

End of function __construct

Function getemail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jfUsh
function name:  getEmail
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~0      'email'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   20     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getemail

Function getdomain:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jfUsh
function name:  getDomain
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   FETCH_OBJ_R                                      ~0      'domain'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   25     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getdomain

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jfUsh
function name:  __toString
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   FETCH_OBJ_R                                      ~0      'email'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   30     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function __tostring

Function setdomainfromemail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jfUsh
function name:  setDomainFromEmail
number of ops:  12
compiled vars:  !0 = $email, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   RECV                                             !0      
   34     1        INIT_NS_FCALL_BY_NAME                                    'App%5CEntity%5Cpreg_match'
          2        SEND_VAL_EX                                              '%2F%5E.%2B%40%28.%2A%29%2F'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   35     6        FETCH_DIM_IS                                     ~4      !1, 1
          7        COALESCE                                         ~5      ~4
          8        QM_ASSIGN                                        ~5      null
          9        ASSIGN_OBJ                                               'domain'
         10        OP_DATA                                                  ~5
   36    11      > RETURN                                                   null

End of function setdomainfromemail

End of class App\Entity\Email.

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

End of function __construct

Function getid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jfUsh
function name:  getId
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   56     0  E >   FETCH_OBJ_R                                      ~0      'id'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   57     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getid

Function getfirstname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jfUsh
function name:  getFirstName
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   61     0  E >   FETCH_OBJ_R                                      ~0      'firstName'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   62     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getfirstname

Function getlastname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jfUsh
function name:  getLastName
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   66     0  E >   FETCH_OBJ_R                                      ~0      'lastName'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   67     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getlastname

Function getemail:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jfUsh
function name:  getEmail
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   71     0  E >   FETCH_OBJ_R                                      ~0      'email'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   72     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getemail

Function getcuid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jfUsh
function name:  getCuid
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   76     0  E >   FETCH_OBJ_R                                      ~0      'cuid'
          1        VERIFY_RETURN_TYPE                                       ~0
          2      > RETURN                                                   ~0
   77     3*       VERIFY_RETURN_TYPE                                       
          4*     > RETURN                                                   null

End of function getcuid

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jfUsh
function name:  __toString
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   81     0  E >   FETCH_OBJ_R                                      ~0      'firstName'
          1        ROPE_INIT                                     3  ~3      ~0
          2        ROPE_ADD                                      1  ~3      ~3, '+'
          3        FETCH_OBJ_R                                      ~1      'lastName'
          4        ROPE_END                                      2  ~2      ~3, ~1
          5        VERIFY_RETURN_TYPE                                       ~2
          6      > RETURN                                                   ~2
   82     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function __tostring

End of class App\Entity\User.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.19 ms | 1023 KiB | 14 Q