This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$numbers = []; | |
define('size', 10000); | |
for ($i=0 ; $i<size; $i++) { | |
$numbers[] = $i; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Prevent strace from abbreviating arguments? | |
# You want the -s strsize option, which specifies the maximum length of a string to display (the default is 32). | |
# running siege | |
# siege -d10 -c50 http://basereality.test | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$performGC = false; | |
if ($performGC) { | |
echo "GC collection will be done - app should not crash.\n"; | |
} | |
else { | |
echo "GC collection won't be done - app should crash.\n"; |
Hi,
I've been going through some bug reports, and have found there are several bad behaviours related to class constructors that ought to be corrected, but could only be done at a major version. The bad behaviours are:
Several classes in PHP return null when there is a problem in the parameters passed to their constructor e.g.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Document {} | |
interface JSONDocument extends Document {} | |
interface XMLDocument extends Document {} | |
// If PHP had it we could use covariance on the params | |
// interface Printer { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Prevent strace from abbreviating arguments? | |
# You want the -s strsize option, which specifies the maximum length of a string to display (the default is 32). | |
# -etrace=!open means to trace every system call except open. In addition, the special values all and none have the obvious meanings. | |
#-etrace=!open | |
#-e trace=!write. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$defaultCase = function ($x) { | |
return $x."\n"; | |
}; | |
$buzz = function ($x, callable $modify) { | |
if (($x%5) == 0) { | |
return "Buzz\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Without manually calling gc_collect_cycles() | |
============================================ | |
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 139264 bytes) in - on line 27 | |
GC Statistics | |
------------- | |
Runs: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TEMPORARY TABLE mediaSelected ( | |
mediaId int, | |
itemId int | |
); | |
CREATE TEMPORARY TABLE mediaRejected ( | |
mediaID int, | |
itemID int | |
); |
NewerOlder