3v4l.org

run code in 300+ PHP versions simultaneously
<?php $updatedPapers = []; $count = 0; foreach ($this->paperList as $key => $paper) { $updatedPapers[$count] = $obj1; $count ++; if($paper->nup %2 != 0 && $paper->nup != 1){ $updatedPapers[$count] = $obj2; $count ++; } } ?> /** obj1 and obj2 get returned from a function with the below values. It seems the obj2 is overwriting obj1. obj1 ( [sheet_size_id] => 2 [sheet_size] => B1 [sheet_width] => 1020 [sheet_height] => 720 [printable_width] => 1005 [printable_height] => 704 [print_cost] => 5.69 [gsm] => 130 [thickness] => 95 [finish] => gloss [tonne_rate] => 660 [brand_name] => Chorus [brand_code] => Chorus [supplier_name] => EBBs [supplier_code] => EBBs [machine] => XL106 [machine_id] => 2 [method] => Litho [nup] => 9 [sections] => Array ( [0] => Array ( [leafs] => 2 [sheets] => 250 [method] => Work and Turn [plates] => 4 ) ) [totalPlates] => 4 [sheets] => 250 ) obj2 ( [sheet_size_id] => 2 [sheet_size] => B1 [sheet_width] => 1020 [sheet_height] => 720 [printable_width] => 1005 [printable_height] => 704 [print_cost] => 5.69 [gsm] => 130 [thickness] => 95 [finish] => gloss [tonne_rate] => 660 [brand_name] => Chorus [brand_code] => Chorus [supplier_name] => EBBs [supplier_code] => EBBs [machine] => XL106 [machine_id] => 2 [method] => Litho [nup] => 9 [sections] => Array ( [0] => Array ( [leafs] => 9 [sheets] => 223 [method] => Sheet Work [plates] => 8 ) ) [totalPlates] => 8 [sheets] => 1000 )
Output for rfc.property-hooks, git.master, git.master_jit
Fatal error: Uncaught Error: Using $this when not in object context in /in/Vh8J9:6 Stack trace: #0 {main} thrown in /in/Vh8J9 on line 6
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
99.96 ms | 1643 KiB | 4 Q