Re: first php 5 class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/30/08, Nathan Nobbe <quickshiftin@xxxxxxxxx> wrote:
> php has an interactive shell; php -a.
> therein you have access to anything in the language your
> include path, or the local disc.

You obviously have a very different understanding of the word "interactive".

`php -a` seems pretty broken to me:

> php -a
Interactive mode enabled

sprintf( '%f^[[3~^[[3~

My backspace doesn't work.  Ctrl-C to start over.  I'm guessing I
would lose any local variables at this point?

> php -a
Interactive mode enabled

echo 'foo';

So where's the output?


> php -a
Interactive mode enabled

^[[A

Aww..  no up-arrow history either?

`php -a` doesn't work very well from where I sit.


IRB actually works:

> irb
>> [].class
=> Array
>> [].methods.sort
=> ["&", "*", "+", "-", "<<", "<=>", "==", "===", "=~", "[]", "[]=",
"__id__", "__send__", "all?", "any?", "assoc", "at", "class", "clear",
"clone", "collect", "collect!", "compact", "compact!", "concat",
"delete", "delete_at", "delete_if", "detect", "display", "dup",
"each", "each_index", "each_with_index", "empty?", "entries", "eql?",
"equal?", "extend", "fetch", "fill", "find", "find_all", "first",
"flatten", "flatten!", "freeze", "frozen?", "gem", "grep", "hash",
"id", "include?", "index", "indexes", "indices", "inject", "insert",
"inspect", "instance_eval", "instance_of?",
"instance_variable_defined?", "instance_variable_get",
"instance_variable_set", "instance_variables", "is_a?", "join",
"kind_of?", "last", "length", "map", "map!", "max", "member?",
"method", "methods", "min", "nil?", "nitems", "object_id", "pack",
"partition", "po", "poc", "pop", "pretty_inspect", "pretty_print",
"pretty_print_cycle", "pretty_print_inspect",
"pretty_print_instance_variables", "private_methods",
"protected_methods", "public_methods", "push", "rassoc", "reject",
"reject!", "replace", "require", "respond_to?", "reverse", "reverse!",
"reverse_each", "ri", "rindex", "select", "send", "shift",
"singleton_methods", "size", "slice", "slice!", "sort", "sort!",
"sort_by", "taint", "tainted?", "to_a", "to_ary", "to_s", "transpose",
"type", "uniq", "uniq!", "unshift", "untaint", "values_at", "zip",
"|"]


And since you can't see it I will also mention that IRB has beautiful
syntax highlighting.


> however, ive never heard of an extension whereby the debugger
> drops you into a 'php -a' session.
>
> and btw.  php does have pecl and pear, these are both modular

Every time I ever went to the PEAR site I played a game of 'how many
times do I have to click before I dig down deep enough to realize the
docs aren't really there'.

Meanwhile every gem you install with Ruby has an rdoc package with
complete api docs for the gem.  You just fire up your local `gem
server` and browse to http://localhost:8808/ to view complete api
docs, offline or on.


-- 
Greg Donald
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux