Skip to content

Instantly share code, notes, and snippets.

@dhoko
Last active December 19, 2015 18:19
Show Gist options
  • Save dhoko/5998216 to your computer and use it in GitHub Desktop.
Save dhoko/5998216 to your computer and use it in GitHub Desktop.
Java vs PHP - Op.php
<?php
/**
* PHP 5.3.3-7+squeeze15
* php op.php
*/
class Op
{
private $lang = '';
private $id = null;
function __construct()
{
$this->id = 5;
$this->lang = '';
}
public static function main() {
$stack = array();
$howMuch = 0;
while(1) {
echo 'create : ',$howMuch, 'OpObject', "\n";
for ($i=0; $i < 1000; $i++) {
$stack[] = new Op();
$howMuch++;
}
if($howMuch === 8000000) exit(2);
}
}
}
Op::main();
@novln
Copy link

novln commented Jul 16, 2013

Testé sous 5.4 ce matin ;)

Il plante à 2 millions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment