Last active
April 21, 2016 23:18
-
-
Save brianlmoon/ebf7faafe69ff0131ac2 to your computer and use it in GitHub Desktop.
WTF PHP current() on object?
This file contains hidden or 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 Foo { | |
private $bar = "private variable 1"; | |
private $bar2 = "private variable 2"; | |
} | |
$foo = new Foo; | |
echo current($foo)."\n"; | |
echo next($foo)."\n"; | |
// Output: | |
// $ php test.php | |
// private variable 1 | |
// private variable 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome