-
Notifications
You must be signed in to change notification settings - Fork 0
/
002.phpt
58 lines (54 loc) · 1.17 KB
/
002.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--TEST--
Test arena functionality
--SKIPIF--
<?php if (!extension_loaded('cereal')) die('skip: cereal extension required'); ?>
--INI--
cereal.use_arena=1
--FILE--
<?php
echo 'Where are my Lucky Charms?' . PHP_EOL;
$cereal = new Cereal();
$cereal->name = 'Lucky Charms';
var_dump($cereal);
$cereal2 = get_cereal();
$cereal2->name = 'Cinnamon Toast Crunch';
$cereal2->milk = 'almond';
var_dump($cereal2);
function userlandCereals() {
foreach (range(0, 3) as $i) {
$c = new Cereal();
echo 'Made userland cereal #' . spl_object_id($c) . PHP_EOL;
}
}
function internalCereals() {
foreach (range(0, 3) as $i) {
$c = get_cereal();
echo 'Made internal cereal #' . spl_object_id($c) . PHP_EOL;
}
}
userlandCereals();
internalCereals();
?>
--EXPECTF--
Where are my Lucky Charms?
object(Cereal)#1 (2) {
["name"]=>
string(12) "Lucky Charms"
["milk"]=>
string(0) ""
}
object(Cereal)#2 (2) {
["name"]=>
string(21) "Cinnamon Toast Crunch"
["milk"]=>
string(6) "almond"
}
Made userland cereal #3
Made userland cereal #4
Made userland cereal #5
Made userland cereal #6
Made internal cereal #7
Made internal cereal #8
Made internal cereal #9
Made internal cereal #10
Freeing arena (%s)