logs archiveIRC Archive / Freenode / #php / 2015 / July / 15 / 1
Sammitch
dang. I've already written a couple things without the vendor in there :I
caffinated
Sammitch: it's not a huge problem - adding the vendor name just makes it harder for a collision to occur in naming.
n3tim
(Action) test
Sammitch
haha well... one of those root namespaces happens to be 'OpenStack' :I
__adrian
*might* collide with something
someday
caffinated
you could have collisions in a 3 part namespace too
so it's really just playing the odds
Sammitch
¯\_(Ä)_/¯
at least it only lives in an internal repo right now, I'll have to remember to fix it once I make it public
caffinated
shouldn't be too hard to refactor it and existing projects.
assuming it's really worth worrying about
blanketmind
token_get_all() has very strange output. Basically, you get an array of arrays, where it will say T_STRING, 'some_function_name', line. Okay, so what use it it to me that I know that 'some_function_name' is a "T_STRING"? There is nothing that indicates that it's actually a function name.
Or am I missing something?
         

__adrian
function names *are* strings
blanketmind
The explanation of T_STRING is "identifiers, e.g. keywords like parent and self, function names, class names and more are matched. See also T_CONSTANT_ENCAPSED_STRING."
I... guess... it's useful if I wanna modify them all.
Is there a way to determine whether a given identifier is in "user code" or "built into PHP"?
caffinated
all the identifiers are showing you tokenized source.
__adrian
i suppose you'd have to whitelist them.
never really thought about it, though.
caffinated
there is no way for the tokenizer to know the difference between user defined functions and internal functions. to the tokenizer, they're just functions.
blanketmind
I mean, can I do is_built_in_symbol() or something?
if (is_built_in_symbol('strlen')) { ... }
__adrian
__adrian | i suppose you'd have to whitelist them.
blanketmind
How? What do you mean?
caffinated
you could probably do something with http://php.net/get_defined_functions
it differentiates between internal and user defined.
__adrian
?
no it doesn't
blanketmind
Good, although that's just functions.
caffinated
__adrian: sure it does.
__adrian
oh, yes, it does.
hm. interesting.
blanketmind
if (!in_array($test_function_name, get_defined_functions[0]))
Should probably work.
caffinated
BeWilled_: not unless you actually call the function, but yes.
blanketmind
Actually, it's an associative array, I think.
__adrian
blanketmind
I thought all associative arrays were also index-arrays.
__adrian
...no...
caffinated
BeWilled_: they are, but that doesn't mean you'll have numeric keys.
it's better to think of arrays as "hashmaps with array-like functionality"
         

__adrian
they have an order, yes. associated numeric keys, no
blanketmind
['internal'] also doesn't work.
caffinated
BeWilled_: then you're doing something else wrong.
__adrian
blanketmind
Oh. I didn't do the () before the [.
caffinated
hence the "not unless you actually call the function"
__adrian
blanketmind, if you're doing this more than once, you'd be better off calling the function only _once_, and comparing against the result.
rather than calling the function over and over.
retran
depends what the function does
just jumping in here
blanketmind
Okay. Problem. get_defined_vars doesn't distinct between user and built in ones, apparently.
__adrian: Yeah.
__adrian
retran: yes, but i don't know how get_defined_functions works internally.
nor do i care to... but i suspect the "user" part is rechecked each invocation
retran
lol, true enough... some function like that would be nearly pointless to repeat iteratively
caffinated
blanketmind: yes, yes it does.
__adrian
at least.
retran
as a purist, i just keep thinking back to the classical definition of a "function"
__adrian
s/purist/old fogey/
?
caffinated
blanketmind: were you not paying attention? did you not actually look at the documentation?
retran
old enough, sure. a function should take an one or more params... and poop out a result
snooky
hi all
german?
retran
but most of the time we "conflate" a function with a "named group of procedures"
that's an old battle that's lost long ago
caffinated
snooky: there are germans here, but this is an English language channel.
blanketmind
caffinated: I'm looking for the third time now just to make sure.
snooky
i dont really good speak english but i need help with an problem with an extension
i became this error: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525+lfs/suhosin.so' - /usr/lib/php5/20100525+lfs/suhosin.so: cannot open shared object file: No such file or directory at Unknown#0
but i have installed the extension
caffinated
snooky: I was going to say ##php.de exists, but it looks like you're already in there.
blanketmind
Okay, I confused two manpages.
retran
it should be ok. English is only 600 to 800 years removed from German
blanketmind
How do I deal with the fact that get_defined_vars(), unlike get_defined_functions() and get_defined_constants(), does not distinct between user-defined and built-in/reserved ones?
caffinated
blanketmind: why on earth would it matter?
blanketmind
Or maybe PHP doesn't define any non-global ones...
snooky
everyone can help me with this warning?
http://www.dig-secure.eu
theere is my phpinfo()
caffinated
snooky: it means the file either doesn't exist, or is unreadable
retran
you can never re-define a function in PHP
snooky
caffinated: the file exists
caffinated
snooky: in some limited cases it may point to a missing library that the .so depends on
retran
and all functions are global (there's no scope for functions)
are you less confused now, blanketmind
this isn't javascript
caffinated
snooky: if the .so exists in the specified location, try checking it's link dependencies with ldd
snooky
yes the file exists
caffinated: http://nopaste.linux-dev.org/?632719
caffinated
snooky: 13:55 < caffinated> snooky: if the .so exists in the specified location, try checking it's link dependencies with ldd
snooky
how i can try it`?
caffinated
ldd suhosin.so
snooky
linux-gate.so.1 => (0xb76fd000)
libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xb756a000)
caffinated
don't paste them here
just check that all those files exist
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 next »