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 | |
class MultiArrayAccess implements ArrayAccess | |
{ | |
public function offsetExists($offset) | |
{ | |
echo " EXISTS "; | |
print_r($offset); | |
echo "\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
<?php | |
$max = 10000000; | |
$testValues = range(1, $max); | |
echo php_uname(); | |
echo "\nFill Array with appending elements and for loop\n"; | |
$time = microtime(true); | |
$newArray = []; |
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 | |
function getLevenshtein1($word) | |
{ | |
$words = array(); | |
for ($i = 0; $i < strlen($word); $i++) { | |
// insertions | |
$words[] = substr($word, 0, $i) . '_' . substr($word, $i); | |
// deletions | |
$words[] = substr($word, 0, $i) . substr($word, $i + 1); |