<?php
$one = array( 1, 2, 3 );
$two = array( null );
$two[1] =& $one;
var_dump( $two );
class foo {
static function bar( &$v ) {
var_dump( $v );
}
}
foo::bar( $two );
/*
class foo {
static $mem;
static function setMem( &$v ) {
self::$mem[ $v[0] ] = $v[1];
}
static function readMem( &$v ) {
$a = $v[3];
$v[2][$a] =& self::$mem[ $v[1] ];
}
static function reset( &$v ) {
reset( $v[0] );
}
static function each( &$v ) {
var_dump( $v );
$t = each( $v[0] );
self::$mem[ $v[1] ] = $t[1];
}
static function show( &$v ) {
echo $v[0];
}
}
$reset = array(null);
$each = array(null, 'new');
$show = array(null);
$arr = array(
array('variable', array(1, 2, 3) ),
array( 1=>'variable', 3=>0 ),
array(),
array( 1=>'variable', 3=>0 ),
$each,
array( 1=>'new', 3=>0 ),// 5
$show,
);
$arr[1][2] =& $reset;
$arr[2][0] =& $reset;
$arr[3][2] =& $each;
$arr[5][2] =& $show;
$n = 0;
foo::setMem( $arr[$n++] ); // 0
foo::readMem( $arr[$n++] ); // 1
foo::reset( $arr[$n++] ); // 2
foo::readMem( $arr[$n++] ); // 3
var_dump( $each );
foo::each( $arr[$n++] ); // 4
foo::readMem( $arr[$n++] ); // 5
foo::show( $arr[$n++] ); // 6
*/
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/UdVsB
function name: (null)
number of ops: 11
compiled vars: !0 = $one, !1 = $two
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
3 0 E > ASSIGN !0, <array>
4 1 ASSIGN !1, <array>
5 2 FETCH_DIM_W $4 !1, 1
3 ASSIGN_REF $4, !0
7 4 INIT_FCALL 'var_dump'
5 SEND_VAR !1
6 DO_ICALL
15 7 INIT_STATIC_METHOD_CALL 'foo', 'bar'
8 SEND_REF !1
9 DO_FCALL 0
75 10 > RETURN 1
Class foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/UdVsB
function name: bar
number of ops: 5
compiled vars: !0 = $v
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
10 0 E > RECV !0
11 1 INIT_FCALL 'var_dump'
2 SEND_VAR !0
3 DO_ICALL
12 4 > RETURN null
End of function bar
End of class foo.
Generated using Vulcan Logic Dumper, using php 8.0.0
preferences:
155.63 ms | 1395 KiB | 15 Q