View multiarrayaccess.php
<?php
class MultiArrayAccess implements ArrayAccess
{
public function offsetExists($offset)
{
echo " EXISTS ";
print_r($offset);
echo "\n";
}
View arrayFillBenchmark.php
<?php
$max = 10000000;
$testValues = range(1, $max);
echo php_uname();
echo "\nFill Array with appending elements and for loop\n";
$time = microtime(true);
$newArray = [];
View levenshtein1.php
<?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);