Skip to content

Instantly share code, notes, and snippets.

@brianlmoon
Last active April 21, 2016 23:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianlmoon/ebf7faafe69ff0131ac2 to your computer and use it in GitHub Desktop.
Save brianlmoon/ebf7faafe69ff0131ac2 to your computer and use it in GitHub Desktop.
WTF PHP current() on object?
<?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
@Chemaclass
Copy link

Awesome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment