Skip to content

Instantly share code, notes, and snippets.

@oriadam
oriadam / isAssocArrayBench.php
Last active May 19, 2021 10:43 — forked from Thinkscape/isAssocArrayBench.php
A benchmark of several methods for checking if PHP array is associative
<?php
$iterations = $argv[1] ?: 10000;
/**
* Arrays to check
*/
$tests = array(
array(array(
'foo' => 'bar',
)),
array(array(