略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: FETCH_OBJ_FUNC_ARG

2024-12-21

FETCH_OBJ_FUNC_ARG

PHP code

<?php
/*
 * 
 * opcode number: 94
 */
include './classA.php';

function 
foo(&$x)
{
  print(
$x);
}

$z "foo";

$obj = new A();
print 
$obj->num;
$z($obj->num);

?>

PHP opcodes

Function name: (null)

Compiled variables: !0=$z, !1=$obj

line#op fetchextreturn operands
60 INCLUDE_OR_EVAL     '.%2FclassA.php',INCLUDE
81 NOP      
132 ASSIGN     !0,'foo'
153 ZEND_FETCH_CLASS   :2 'A'
 4 NEW   $3 :2
 5 DO_FCALL_BY_NAME  0   
 6 ASSIGN     !1,$3
167 FETCH_OBJ_R   $6 !1,'num'
 8 PRINT   ~7 $6
 9 FREE     ~7
1710 INIT_FCALL_BY_NAME     !0
 11 FETCH_OBJ_FUNC_ARG   $8 !1,'num'
 12 SEND_VAR     $8
 13 DO_FCALL_BY_NAME  1   
1914 RETURN     1

Function name: foo

Compiled variables: !0=$x

line#op fetchextreturn operands
80 RECV     1
101 PRINT   ~0 !0
 2 FREE     ~0
113 RETURN     null

Function name: foo

Compiled variables: !0=$x

line#op fetchextreturn operands
80 RECV     1
101 PRINT   ~0 !0
 2 FREE     ~0
113 RETURN     null
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/internals2.opcodes.fetch-obj-func-arg.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3