3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Person { public $name; public $age; function __construct($name, $age) { $this->name=$name; $this->age=$age; } function say() { echo "我的名字叫:".$this->name."<br />"; echo "我的年龄是:".$this->age; }}$p1 = new Person("张三", 20);$p1->say();$p2 = clone $p1;$p2->say(); $p1->name='hu'; $p2->say(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iI8BG
function name:  (null)
number of ops:  16
compiled vars:  !0 = $p1, !1 = $p2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $2      'Person'
          1        SEND_VAL_EX                                              '%E5%BC%A0%E4%B8%89'
          2        SEND_VAL_EX                                              20
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $2
          5        INIT_METHOD_CALL                                         !0, 'say'
          6        DO_FCALL                                      0          
          7        CLONE                                            ~6      !0
          8        ASSIGN                                                   !1, ~6
          9        INIT_METHOD_CALL                                         !1, 'say'
         10        DO_FCALL                                      0          
    3    11        ASSIGN_OBJ                                               !0, 'name'
         12        OP_DATA                                                  'hu'
    4    13        INIT_METHOD_CALL                                         !1, 'say'
         14        DO_FCALL                                      0          
    5    15      > RETURN                                                   1

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

End of function __construct

Function say:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/iI8BG
function name:  say
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   FETCH_OBJ_R                                      ~0      'name'
          1        CONCAT                                           ~1      '%E6%88%91%E7%9A%84%E5%90%8D%E5%AD%97%E5%8F%AB%EF%BC%9A', ~0
          2        CONCAT                                           ~2      ~1, '%3Cbr+%2F%3E'
          3        ECHO                                                     ~2
          4        FETCH_OBJ_R                                      ~3      'age'
          5        CONCAT                                           ~4      '%E6%88%91%E7%9A%84%E5%B9%B4%E9%BE%84%E6%98%AF%EF%BC%9A', ~3
          6        ECHO                                                     ~4
          7      > RETURN                                                   null

End of function say

End of class Person.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.08 ms | 1395 KiB | 13 Q