Ben Lobaugh Online

I think, therefore I am. I am, therefore I sail

Quick tip to access protected properties in PHP object

Calling an object that has a protected property that you need access to? This function will allow you to quickly access data stored in protected properties of PHP objects.

Note: I tested this on PHP 7.4. It will likely work on other versions, but may need tweaking.

Good developers will protect the internals of their objects with private and protected scopes. That means from outside of the object your code will not be able to access whatever is protected. What I am about to show you breaks that encapsulation. Generally, this is not something you want to do, however, if you are working with an object you have no control over, it may be necessary. I ran across this while working with an object from an external library.

This method works by typecasting the object to an array. You can then access the property using a little known method.

Let’s see the code!

    function getProtectedValue( $object, $prop_name ) { 
        $array = ( array ) $object;
        $prefix = chr( 0 ) . '*' . chr( 0 );
        return $array[ $prefix . $prop_name ];
    } 

Photo courtesy of Unsplash https://unsplash.com/photos/Vp3oWLsPOss

Finally- A Diet That Works! My Experience With Intermittent Fasting

I was huge, giant of a man…. but in the wrong direction. Hey, I like to eat ok? Though I am always busy, I am not particularly active. In the last few years the pounds have really packed on.

I felt yucky and uncomfortable in my own skin. A change was needed, and quickly.

When it comes to what I eat, I am pretty lazy. Whatever is quick is what I will grab, which usually also means the most unhealthy. Knowing my history of not putting much effort into meals, I knew that whatever diet I went on had to be easy, in the extreme. No special foods, or big meal prep days. I would fall off that wagon quickly.

It was at this point a coworker introduced me to Intermittent Fasting (IF).

Fasting is simple, just do not eat. Well, that solves one checkbox, but I was concerned about lack of concentration, energy, and focus.

The more research I did into IF, the more benefits for the body and brain I uncovered, and then I ran across this video by Dr. Jason Fung and was hooked.

I committed to trying IF for one month, decided on the 16:8 model, and set a date to begin (I had to finish all the cookies in the house first!).

The 16:8 model means you fast for 16 hours and have an 8 hour window where you can eat. 16 hours is the shortest amount of time that will put your body into ketosis, or the first level of fat burning.

The first day was surprisingly easy, and the second, and the third, and the first week, and the third week. In fact, it has all been easy. Before starting IF, I was often hungry, and if anything, knowing I was working toward a goal made it easier to go without food and remain a good human. My energy level has gone up, not down.

As it so happened, with my work schedule, I have averaged 19.5:4.5 for the past month and a half. That puts my body in a much longer state of ketosis, which lets it burn more fat, more rapidly.

The effect has been noticeable. Not only to I feel thinner, and look thinner, it is also much easier to breathe. Activities that were quickly tiring me out before I easily power through now. I also feel a lot more alert during the day, and sleep better during the night.

During this first month and half I have lost twenty pounds!!!

Here is a before and after shot. The side view looks similar in the photos, but in real life it is quite different.

My wife asked me what is next, and I told her I am going to keep on the IF bandwagon! I am making a couple changes however. I enjoy the time together with my family during breakfast and have designated Saturday as a day that does not have strict IF, so I can enjoy the time with them. I am also experimenting with OMAD, or One Meal A Day. After 19.5 hours of fasting, I have something to eat and a couple hours later is dinner time. I have naturally seen a shift to OMAD for several days now already.

My conclusion- Intermittent Fasting is a great way to diet and lose weight. There is no food tracking, no food prep, no extra money spent, in fact you save money by not eating! Perhaps biggest of all, since you are not eating, there is no temptation to “cheat” and add that extra scoop of whatever your diet restricts you on.

If you are looking for a weight loss diet, I highly recommend checking out IF. To start, watch Dr. Jason Fung’s video. From there, do the research you need to understand the process.

And as always, I am not a doctor, nor a medially trained person. What I have shared here is my experience, which may not be typical. Consult your doctor before making any life changes that may affect your health.

Ecco Pro filtered tank

Eheim Ecco Pro Canister Filter Review

This post may contain affiliate links. If you buy something through a link I will receive a small commission from the seller, at no additional cost to you.


With the upcoming build of my 90 gallon aquarium, I have been using my 30 gallon tank as a bit of a testbed for exploring different filtration methods. Thus far I have implemented an under gravel and a homemade sump.  Both have worked quite well. In this article, I will share the results of using the Eheim Ecco Pro canister filter. 

Ecco Pro

For three decades I have turned to under gravel filters as my filtration method of choice. Though incredibly simple, I will always contend that, when properly set up, the under gravel filter is a fantastic choice.

The sump was not your traditional sump, it was made from a 5 gallon bucket. I posted details on it in this article. It took some fiddling to get it, but in the end, it did the job it was supposed to do and kept the water a lot more clean than the under gravel filter. However, the wife was not a fan of the running water noise it produced, so back to the drawing board. 

While visiting my parents, I took a look at my father’s fish gear cabinet. There are things in there that have not been made in decades! It is a treasure trove, and in the corner of that pile, I spotted an Eheim Ecco Pro canister filter. I had found my next filter to test!

The hoses were missing and it was covered in thick, crusty, dust. My father did not know if it worked. I brought it home, disassembled it, and cleaned it up. When I first popped it open I was pleased to find it had three media compartments, which still contained Eheim’s glass beads. The Eheim Ecco Pro is a small canister, which gave me pause, 30 gallons is not a big tank, would this provide enough filtration?

Ecco Pro Media Baskets

The Ecco Pro is an outside-in filter, meaning that water comes into the canister around the outside of the media baskets. It is then sucked up from the bottom and through the middle of the media baskets. Water then gets pushed out the top via a return pump, and back into the tank. 

With filtration, there are three components that go into every system: mechanical, biological, and chemical. Unless you are an advanced fish keeper, they should also go in that order. When I looked at the order in the Ecco Pro baskets, I noticed the biological filtration was before the mechanical. Not only that, but Eheim’s own manual also shows it that way! For an otherwise great product, this misinformation disappointed me. Not to worry though, the baskets are highly configurable. I simply swapped in some of my own filter floss and moved the biological filtration later in the stack. 

Ecco Pro Sink Test

The Ecco Pro has been running on the 30 gallon for a couple months (as of the writing of this article). The numbers on my water test kit are consistently on target. The pump is nearly silent and there is no water flow noise, a big plus for my wife. I was able to use some common hose that I picked up at the local hardware store for cheap. 

Ecco Pro filtered tank

Would I use a canister filter on the 90 gallon tank? Yes, but not an Ecco Pro. 30 gallons is the max I would consider using it on. 

Do I recommend the Eheim Ecco Pro canister filter? Absolutely! It is a great unit, quiet and compact. The Eheim glass bio-media works well. Just make sure you put the mechanical filter in front of the biological or the biological media will gum up real fast and become ineffective. 

Link to manual

Check prices on amazon. 

Seventh week update on the nano reef tank cleanup

Seven weeks into the saltwater, nano reef, cleanup, and the tank is looking great. With the help of the newest cleanup crew members from Reef Cleaners, the tank has finally stabilized itself and the water is crystal clear.

The inhabitants are quite happy. The coral polyps have been showing signs of growth. I am guessing that over the next two weeks, all the original algae issues will be gone.

For comparison, here was the tank as I received it:

Nano Reef Tank Crashed

A few Aiptasia keep popping up, but the numbers are few and fewer.

Oscar, the Emerald Crab, has already pulled in 66 followers on his new Instagram account! You should go follow him too.

Here are a few more photos around the tank:

P.S. I found the Nano Reef site and it has been consuming me. I ran across TheRope’s 3 Gallon Pico tank and ReefJar.com and have been having some very naughty thoughts about starting up my own pico reef tank…. trying to decide between coral or rock anemones at the moment….

New fish for the 30 gallon freshwater tank

Having been stuck at home for the last few weeks, I have been playing with my tanks. That, of course, has had me wanting to change things up a bit.

I had intended to swap the 30 with the 90-gallon tank by now and was waiting to get new fish, but I decided that with the elevated light that an algae bloom was well on its way. The Wet Spot, maybe the best fish store on the West Coast is offering free shipping this month, so I sprang for some new fish.

Specifically, I have been wanting a Golden Nugget Pleco.

The German Blue Rams have caught my fancy too.

So I ordered them! Tossed a few Cardinal Tetras in as well.

It has been a couple of weeks since they arrived, and I am really enjoying this Ram.

Page 1 of 163

Powered by WordPress & Beards