3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); final class Person { public function __construct( public readonly string $first, public readonly string $last ) { } } $json = '{"first": "Cher"}'; $data = json_decode($json); $person = new Person($data->first, $data->last);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JoNLT
function name:  (null)
number of ops:  15
compiled vars:  !0 = $json, !1 = $data, !2 = $person
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   ASSIGN                                                       !0, '%7B%22first%22%3A+%22Cher%22%7D'
   15     1        INIT_FCALL                                                   'json_decode'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $4      
          4        ASSIGN                                                       !1, $4
   17     5        NEW                                                  $6      'Person'
          6        CHECK_FUNC_ARG                                               
          7        FETCH_OBJ_FUNC_ARG                                   $7      !1, 'first'
          8        SEND_FUNC_ARG                                                $7
          9        CHECK_FUNC_ARG                                               
         10        FETCH_OBJ_FUNC_ARG                                   $8      !1, 'last'
         11        SEND_FUNC_ARG                                                $8
         12        DO_FCALL                                          0          
         13        ASSIGN                                                       !2, $6
         14      > RETURN                                                       1

Class Person:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JoNLT
function name:  __construct
number of ops:  7
compiled vars:  !0 = $first, !1 = $last
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
    9     1        RECV                                                 !1      
    8     2        ASSIGN_OBJ                                                   'first'
          3        OP_DATA                                                      !0
    9     4        ASSIGN_OBJ                                                   'last'
          5        OP_DATA                                                      !1
   11     6      > RETURN                                                       null

End of function __construct

End of class Person.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.48 ms | 1481 KiB | 14 Q