3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class FullName { public $forename; public $surname; public function __construct(string $forename, string $surname) { $this->forename = $this->validateAndNormalize($forename); $this->surname = $this->validateAndNormalize($surname); } private function validateAndNormalize($name) : string { return ucwords($name); } public function __toString() { return $this->forename . ' ' . $this->surname; } } $o = new FullName('aaa', 'bbb'); echo $o; echo PHP_EOL; $str = 'Full name is' . $o; echo $str;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ibVcC
function name:  (null)
number of ops:  12
compiled vars:  !0 = $o, !1 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'fullname'
   28     1        NEW                                              $2      'FullName'
          2        SEND_VAL_EX                                              'aaa'
          3        SEND_VAL_EX                                              'bbb'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $2
   29     6        ECHO                                                     !0
   30     7        ECHO                                                     '%0A'
   31     8        CONCAT                                           ~5      'Full+name+is', !0
          9        ASSIGN                                                   !1, ~5
   32    10        ECHO                                                     !1
   33    11      > RETURN                                                   1

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

End of function __construct

Function validateandnormalize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ibVcC
function name:  validateAndNormalize
number of ops:  8
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   19     1        INIT_FCALL                                               'ucwords'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4        VERIFY_RETURN_TYPE                                       $1
          5      > RETURN                                                   $1
   20     6*       VERIFY_RETURN_TYPE                                       
          7*     > RETURN                                                   null

End of function validateandnormalize

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

End of function __tostring

End of class FullName.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.86 ms | 1015 KiB | 14 Q