PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

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

PHP Manual