UPDATE: 29/11/2005:

Hi,

I have just released a new version of this script. Its now been converted to a class, renamed so it better describes what it does, and there are a few new features since my original post.

Any feedback would be great 🙂 .

PHP Dump 1.2

Jack

    Didn't really dive into the nuts and bolts, but instead of grouping a bunch of functions, envelop this code in a class (ie out($variable); becomes $outputs->out($variable); or whatever you instantiate the class as.) This seems possible with very little modification.

      I did consider that, and it would still be very easy to implement, however the reason ive not done it yet is that it would increas what you would have to type to use the function, and as it is entirely for use when debugging, i wanted to make it as quick and easy to use as possible. Thats the reason the function is called "out", rather than something like "var_dump2", i just wanted to make the usage as easy as possible.

      out($var);

      Would become something like:

      $out = new output;
      $out->out($var);

        Well, for what it's worth, I just transformed it (so weirdos like me can have a class object version ;-)

        attached file (was too large to post.)

          bretticus wrote:

          Well, for what it's worth, I just transformed it (so weirdos like me can have a class object version ;-)

          attached file (was too large to post.)

          Lol, well in that case i may provide a class version as well then 🙂 . If you could let me know what you think of it that would be great, i want to make this script REALLY good 🙂 .

            Sorry, I've been working on stuff after posting today and haven't had a chance to play with it.

            BTW...nice site!

              Played with it a bit, the array output is way cool. My only complaint, so far is that every object (class hahahaha) that i sent to it results in unsupported type whereas var_dump works great.

              and I just noticed, your out_outputType function is missing a is_object switch. How bout having a default switch that uses var_dump???

              oh by the way, the timestamp detector is a good idea.

                another thing, I think it might be good to refer to another function to format your get_resource_type function call so it can do files, etc.

                  Hi bretticus,

                  cheers for the feedback. Completly forgot about objects, oops, will add that in. Yeah, would be a good idea to use var_dump as the default. Will do that.

                  Thanks for the feedback on the site 🙂 .

                  By the way, if you or anyone here hppened to post a comment, i have just made a massive screw up when synchronizing the database, and deleted all the comments 🙁 . Please re-post them. There were only two mind, and one is accounted for.

                    bretticus wrote:

                    another thing, I think it might be good to refer to another function to format your get_resource_type function call so it can do files, etc.

                    Good idea, its been added to the list. I always knew there would be more resource types it could output, i just wasnt sure what they all were.

                      I've now updated Output Functions with the changes you mentioned:

                      • Support for the stream resource type

                      • Support for objects

                      • Defaults to var_dump if an unsupported type is sent

                        10 days later

                        New update, see original post (its been edited).

                          Write a Reply...