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 $id, $carbohydrates, $measures; 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->id = $id; $this->carbohydrates = $carbohydrates; $this->measures = $measures; } } $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/dGCQR
function name:  (null)
number of ops:  9
compiled vars:  !0 = $entity
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  42     0  E >   NEW                                              $1      :13
         1        DO_FCALL                                      0          
         2        INIT_METHOD_CALL                                         $1, 'hydrate'
         3        DO_FCALL                                      0  $3      
         4        QM_ASSIGN                                                !0
  43     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/dGCQR
function name:  hydrate
number of ops:  12
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  24     0  E >   NEW                                              $0      :19
         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        DO_FCALL                                      0          
         8        VERIFY_RETURN_TYPE                                       $0
         9      > RETURN                                                   $0
  25    10*       VERIFY_RETURN_TYPE                                       
        11*     > 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/dGCQR
function name:  __construct
number of ops:  18
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
-------------------------------------------------------------------------------------
  32     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     
  36    11        ASSIGN_SUB                                    0          'id'
        12        OP_DATA                                                  !0
  37    13        ASSIGN_SUB                                   24          'carbohydrates'
        14        OP_DATA                                                  !7
  38    15        ASSIGN_SUB                                   48          'measures'
        16        OP_DATA                                                  !10
  39    17      > RETURN                                                   null

End of function __construct

End of class Cookpedia\Entity.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
31.39 ms | 422 KiB | 15 Q