3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Cookpedia; class Entry { private $hydrated = false; private $data = [ 'id' => 0, 'title' => null, 'latin_title' => null, 'category' => 0, 'calories' => 0, 'proteins' => 0, 'fats' => 0, 'carbohydrates' => 0, 'description' => null, 'tags' => [], 'measures' => [], ]; public function hydrate(): Entity { return new Entity(...array_values($this->data)); } } class Entity { public function __construct(int $id, ?string $title, ?string $latinTitle, int $category, int $calories, int $proteins, int $fats, int $carbohydrates, ?string $description, array $tags, array $measures) { $this->carbohydrates = $carbohydrates; } } $entity = (new Entry())->hydrate(); var_dump($entity);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YCYLP
function name:  (null)
number of ops:  9
compiled vars:  !0 = $entity
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   NEW                                              $1      'Cookpedia%5CEntry'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $1, 'hydrate'
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !0, $3
   39     5        INIT_NS_FCALL_BY_NAME                                    'Cookpedia%5Cvar_dump'
          6        SEND_VAR_EX                                              !0
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Class Cookpedia\Entry:
Function hydrate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YCYLP
function name:  hydrate
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $0      'Cookpedia%5CEntity'
          1        INIT_NS_FCALL_BY_NAME                                    'Cookpedia%5Carray_values'
          2        CHECK_FUNC_ARG                                           
          3        FETCH_OBJ_FUNC_ARG                               $1      'data'
          4        SEND_FUNC_ARG                                            $1
          5        DO_FCALL                                      0  $2      
          6        SEND_UNPACK                                              $2
          7        CHECK_UNDEF_ARGS                                         
          8        DO_FCALL                                      1          
          9        VERIFY_RETURN_TYPE                                       $0
         10      > RETURN                                                   $0
   25    11*       VERIFY_RETURN_TYPE                                       
         12*     > RETURN                                                   null

End of function hydrate

End of class Cookpedia\Entry.

Class Cookpedia\Entity:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YCYLP
function name:  __construct
number of ops:  14
compiled vars:  !0 = $id, !1 = $title, !2 = $latinTitle, !3 = $category, !4 = $calories, !5 = $proteins, !6 = $fats, !7 = $carbohydrates, !8 = $description, !9 = $tags, !10 = $measures
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV                                             !3      
          4        RECV                                             !4      
          5        RECV                                             !5      
          6        RECV                                             !6      
          7        RECV                                             !7      
          8        RECV                                             !8      
          9        RECV                                             !9      
         10        RECV                                             !10     
   34    11        ASSIGN_OBJ                                               'carbohydrates'
         12        OP_DATA                                                  !7
   35    13      > RETURN                                                   null

End of function __construct

End of class Cookpedia\Entity.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.67 ms | 1400 KiB | 17 Q